Messages in this thread | | | Date | Mon, 2 Oct 2023 10:39:39 -0700 | From | Kees Cook <> | Subject | Re: [PATCH v5] hwmon: (acpi_power_meter) replace open-coded kmemdup_nul |
| |
On Tue, Sep 26, 2023 at 06:59:15AM +0000, 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.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] > Link: https://github.com/KSPP/linux/issues/90 > Cc: linux-hardening@vger.kernel.org > Signed-off-by: Justin Stitt <justinstitt@google.com>
Thanks for continue to rev this change. This looks much nicer, is more readable, etc. :)
Reviewed-by: Kees Cook <keescook@chromium.org>
-- Kees Cook
| |