On 13. Feb 2025, at 20:14, David Laight wrote:
> On Wed, 12 Feb 2025 23:43:53 +0100
> Thorsten Blum <[email protected]> wrote:
> 
>> strncpy() is deprecated for NUL-terminated destination buffers [1].
>> 
>> Replace memset() and strncpy() with strscpy_pad() to copy the version
>> string and fill the remaining bytes in the destination buffer with NUL
>> bytes. This avoids zeroing the memory before copying the string.
>> 
>> Compile-tested only.
>> 
>> Link: 
>> https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings
>>  [1]
>> Cc: [email protected]
>> Signed-off-by: Thorsten Blum <[email protected]>
>> ---
> 
> Wrong.
> That will truncate maximum length strings.

Yes, I sent a v2 to fix this already.

https://lore.kernel.org/r/[email protected]/

Thanks,
Thorsten


Reply via email to