[PATCH v2] btrfs: Replace deprecated strncpy() with strscpy()

2025-02-25 Thread Thorsten Blum
strncpy() is deprecated for NUL-terminated destination buffers. Use strscpy() instead and don't zero-initialize the param array. Compile-tested only. Link: https://github.com/KSPP/linux/issues/90 Cc: linux-harden...@vger.kernel.org Signed-off-by: Thorsten Blum --- Changes in v2: - Use strscpy()

Re: [PATCH] btrfs: Replace deprecated strncpy() with strscpy_pad()

2025-02-25 Thread Thorsten Blum
On 25. Feb 2025, at 13:28, David Sterba wrote: > On Tue, Feb 25, 2025 at 10:29:49AM +0100, Thorsten Blum wrote: >> strncpy() is deprecated for NUL-terminated destination buffers. Use >> strscpy_pad() instead and don't zero-initialize the param array. >> >> Compile-tested only. >> >> Link: https:/

Re: [PATCH] btrfs: Replace deprecated strncpy() with strscpy_pad()

2025-02-25 Thread David Sterba
On Tue, Feb 25, 2025 at 10:29:49AM +0100, Thorsten Blum wrote: > strncpy() is deprecated for NUL-terminated destination buffers. Use > strscpy_pad() instead and don't zero-initialize the param array. > > Compile-tested only. > > Link: https://github.com/KSPP/linux/issues/90 > Cc: linux-harden...@

[PATCH] btrfs: Replace deprecated strncpy() with strscpy_pad()

2025-02-25 Thread Thorsten Blum
strncpy() is deprecated for NUL-terminated destination buffers. Use strscpy_pad() instead and don't zero-initialize the param array. Compile-tested only. Link: https://github.com/KSPP/linux/issues/90 Cc: linux-harden...@vger.kernel.org Signed-off-by: Thorsten Blum --- fs/btrfs/sysfs.c | 4 ++--