Re: [PATCH] crypto: cavium/nitrox - refactor deprecated strncpy

2023-09-19 Thread Herbert Xu
On Wed, Sep 13, 2023 at 12:32:31AM +, Justin Stitt wrote: > `strncpy` is deprecated for use on NUL-terminated destination strings [1]. > > We know `hw.partname` is supposed to be NUL-terminated by its later use with > seq_printf: > | nitrox_debugfs.c +25 > | seq_printf(s, " Part Name: %

Re: [PATCH] crypto: cavium/nitrox - refactor deprecated strncpy

2023-09-14 Thread Kees Cook
On Wed, Sep 13, 2023 at 12:32:31AM +, Justin Stitt wrote: > `strncpy` is deprecated for use on NUL-terminated destination strings [1]. > > We know `hw.partname` is supposed to be NUL-terminated by its later use with > seq_printf: > | nitrox_debugfs.c +25 > | seq_printf(s, " Part Name: %

[PATCH] crypto: cavium/nitrox - refactor deprecated strncpy

2023-09-12 Thread Justin Stitt
`strncpy` is deprecated for use on NUL-terminated destination strings [1]. We know `hw.partname` is supposed to be NUL-terminated by its later use with seq_printf: | nitrox_debugfs.c +25 | seq_printf(s, " Part Name: %s\n", ndev->hw.partname); Let's prefer a more robust and less ambiguous s