Re: [PATCH] Squashfs: replace deprecated strncpy with strscpy

2024-04-03 Thread Phillip Lougher
On 04/04/2024 01:30, Justin Stitt wrote: On Wed, Apr 3, 2024 at 12:32 PM Phillip Lougher wrote: A better way to remove the strncpy() is to remove the unnecessary string copy, which I have done in this patch here: Great! Cleaning up this code while removing strncpy() is a two for one. Yes -

Re: [PATCH] Squashfs: replace deprecated strncpy with strscpy

2024-04-03 Thread Justin Stitt
On Wed, Apr 3, 2024 at 12:32 PM Phillip Lougher wrote: > A better way to remove the strncpy() is to remove the unnecessary string > copy, which I have done in this patch here: Great! Cleaning up this code while removing strncpy() is a two for one.

Re: [PATCH] Squashfs: replace deprecated strncpy with strscpy

2024-04-03 Thread Phillip Lougher
On 28/03/2024 21:52, 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. The previous code took special care of NUL-terminating the destination buffer via a manual assignment.

Re: [PATCH] Squashfs: replace deprecated strncpy with strscpy

2024-03-28 Thread Kees Cook
On Thu, Mar 28, 2024 at 09:52:59PM +, 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. > > The previous code took special care of NUL-terminating the destination >