Re: [PATCH] drm/gma500: refactor deprecated strncpy

2023-09-18 Thread Patrik Jakobsson
On Thu, Sep 14, 2023 at 09:37:31PM -0700, Kees Cook wrote: > On Thu, Sep 14, 2023 at 08:52:21PM +, Justin Stitt wrote: > > `strncpy` is deprecated for use on NUL-terminated destination strings [1]. > > > > We should prefer more robust and less ambiguous string interfaces. > > > > Since `chan-

Re: [PATCH] drm/gma500: refactor deprecated strncpy

2023-09-14 Thread Kees Cook
On Thu, Sep 14, 2023 at 08:52:21PM +, Justin Stitt wrote: > `strncpy` is deprecated for use on NUL-terminated destination strings [1]. > > We should prefer more robust and less ambiguous string interfaces. > > Since `chan->base.name` is expected to be NUL-terminated, a suitable > replacement

[PATCH] drm/gma500: 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. Since `chan->base.name` is expected to be NUL-terminated, a suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the