Re: [PATCH] SUNRPC: Replace strlcpy() with strscpy()

2023-11-30 Thread Kees Cook
On Tue, 14 Nov 2023 09:54:18 -0800, Kees Cook wrote: > strlcpy() reads the entire source buffer first. This read may exceed > the destination size limit. This is both inefficient and can lead > to linear read overflows if a source string is not NUL-terminated[1]. > Additionally, it returns the size

Re: [PATCH] SUNRPC: Replace strlcpy() with strscpy()

2023-11-16 Thread NeilBrown
On Wed, 15 Nov 2023, Kees Cook wrote: > strlcpy() reads the entire source buffer first. This read may exceed > the destination size limit. This is both inefficient and can lead > to linear read overflows if a source string is not NUL-terminated[1]. > Additionally, it returns the size of the source

[PATCH] SUNRPC: Replace strlcpy() with strscpy()

2023-11-14 Thread Kees Cook
strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated[1]. Additionally, it returns the size of the source string, not the resulting size of the destinat