[PATCH v2] RISC-V: cpu: refactor deprecated strncpy

Kees Cook keescook at chromium.org
Wed Aug 2 13:36:03 PDT 2023


On Wed, Aug 02, 2023 at 12:21:58AM +0000, Justin Stitt wrote:
> `strncpy` is deprecated for use on NUL-terminated destination strings [1].
> 
> Favor not copying strings onto stack and instead use strings directly.
> This avoids hard-coding sizes and buffer lengths all together.
> 
> Link: https://github.com/KSPP/linux/issues/90
> Cc: linux-hardening at vger.kernel.org
> Suggested-by: Kees Cook <keescook at chromium.org>
> Signed-off-by: Justin Stitt <justinstitt at google.com>

I like it! ;)

Reviewed-by: Kees Cook <keescook at chromium.org>

-- 
Kees Cook



More information about the linux-riscv mailing list