Re: [PATCH v4] EDAC/mc_sysfs: refactor deprecated strncpy

2023-09-29 Thread Kees Cook
On Mon, 18 Sep 2023 07:47:29 +, Justin Stitt wrote: > `strncpy` is deprecated for use on NUL-terminated destination strings [1]. > > We've already calculated bounds, possible truncation with '\0' or '\n' > and manually NUL-terminated. The situation is now just a literal byte > copy from one bu

Re: [PATCH v4] EDAC/mc_sysfs: refactor deprecated strncpy

2023-09-23 Thread Kees Cook
On Mon, Sep 18, 2023 at 07:47:29AM +, Justin Stitt wrote: > `strncpy` is deprecated for use on NUL-terminated destination strings [1]. > > We've already calculated bounds, possible truncation with '\0' or '\n' > and manually NUL-terminated. The situation is now just a literal byte > copy from

[PATCH v4] EDAC/mc_sysfs: refactor deprecated strncpy

2023-09-18 Thread Justin Stitt
`strncpy` is deprecated for use on NUL-terminated destination strings [1]. We've already calculated bounds, possible truncation with '\0' or '\n' and manually NUL-terminated. The situation is now just a literal byte copy from one buffer to another, let's treat it as such and use a less ambiguous i