• Stenberg: No strcpy either

    From LWN.net@1337:1/100 to All on Tue Dec 30 22:15:08 2025
    Stenberg: No strcpy either

    Date:
    Tue, 30 Dec 2025 22:01:17 +0000

    Description:
    Daniel Stenberg has written a blog
    post about the decision to ban the use strcpy() in curl: The main challenge with strcpy is that when using it we do not
    specify the length of the target buffer nor of the source string. [...] To make sure that the size checks cannot be separated from the copy
    itself we introduced a string copy replacement function the other day
    that takes the target buffer , target size , source buffer and source string length as arguments
    and only if the copy can be made and the null terminator also fits
    there, the operation is done.

    ======================================================================
    Link to news story:
    https://lwn.net/Articles/1052355/


    --- Mystic BBS v1.12 A49 (Linux/64)
    * Origin: tqwNet UK HUB @ hub.uk.erb.pw (1337:1/100)