MacMusic  |  PcMusic  |  440 Software  |  440 Forums  |  440TV  |  Zicos
strcpy
Search

Stenberg: No strcpy either

Tuesday December 30, 2025. 11:01 PM , from LWN.net
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.
https://lwn.net/Articles/1052355/
News copyright owned by their original publishers | Copyright © 2004 - 2025 Zicos / 440Network
Current Date
Dec, Wed 31 - 03:22 CET