Re: [PATCH] hwmon: (ibmpowernv) refactor deprecated strncpy

2023-09-15 Thread Kees Cook
On Thu, Sep 14, 2023 at 10:40:37PM -0700, Guenter Roeck wrote: > It is really sad that the submitters of such "cleanup" patches can't be > bothered > to check what they are doing. They can't even be bothered to write a > coccinelle > script that would avoid pitfalls like this one, and they

Re: [PATCH] hwmon: (ibmpowernv) refactor deprecated strncpy

2023-09-14 Thread Guenter Roeck
On 9/14/23 22:24, Kees Cook wrote: On Thu, Sep 14, 2023 at 11:21:06PM +, Justin Stitt wrote: `strncpy` is deprecated for use on NUL-terminated destination strings [1]. We should prefer more robust and less ambiguous string interfaces. A suitable replacement is `strscpy` [2] due to the

Re: [PATCH] hwmon: (ibmpowernv) refactor deprecated strncpy

2023-09-14 Thread Kees Cook
On Thu, Sep 14, 2023 at 11:21:06PM +, Justin Stitt wrote: > `strncpy` is deprecated for use on NUL-terminated destination strings [1]. > > We should prefer more robust and less ambiguous string interfaces. > > A suitable replacement is `strscpy` [2] due to the fact that it > guarantees

[PATCH] hwmon: (ibmpowernv) refactor deprecated strncpy

2023-09-14 Thread Justin Stitt
`strncpy` is deprecated for use on NUL-terminated destination strings [1]. We should prefer more robust and less ambiguous string interfaces. A suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding