Re: [PATCH] smb: client: replace deprecated strncpy with strscpy

2024-03-28 Thread Kees Cook
On Thu, Mar 28, 2024 at 09:44:48PM +, Justin Stitt wrote: > strncpy() is deprecated for use on NUL-terminated destination strings > [1] and as such we should prefer more robust and less ambiguous string > interfaces. > > In cifssmb.c: > Using strncpy with a length argument equal to strlen(src)

[PATCH] smb: client: replace deprecated strncpy with strscpy

2024-03-28 Thread Justin Stitt
strncpy() is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. In cifssmb.c: Using strncpy with a length argument equal to strlen(src) is generally dangerous because it can cause string buffers to not be NUL-