Re: [PATCH v5] hwmon: (acpi_power_meter) replace open-coded kmemdup_nul

2023-10-24 Thread Kees Cook
On Tue, 26 Sep 2023 06:59:15 +, Justin Stitt wrote: > `strncpy` is deprecated for use on NUL-terminated destination strings [1]. > > Let's refactor this kcalloc() + strncpy() into a kmemdup_nul() which has > more obvious behavior and is less error prone. > > Applied to for-next/hardening, t

Re: [PATCH v5] hwmon: (acpi_power_meter) replace open-coded kmemdup_nul

2023-10-02 Thread Kees Cook
On Tue, Sep 26, 2023 at 06:59:15AM +, Justin Stitt wrote: > `strncpy` is deprecated for use on NUL-terminated destination strings [1]. > > Let's refactor this kcalloc() + strncpy() into a kmemdup_nul() which has > more obvious behavior and is less error prone. > > Link: > https://www.kernel.

[PATCH v5] hwmon: (acpi_power_meter) replace open-coded kmemdup_nul

2023-09-25 Thread Justin Stitt
`strncpy` is deprecated for use on NUL-terminated destination strings [1]. Let's refactor this kcalloc() + strncpy() into a kmemdup_nul() which has more obvious behavior and is less error prone. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-string