[PATCH] drm/gma500: Replace deprecated strncpy() with strscpy()

Kees Cook kees at kernel.org
Mon Mar 3 18:47:56 UTC 2025


On Tue, Feb 25, 2025 at 09:39:32PM +0100, Thorsten Blum wrote:
> strncpy() is deprecated for NUL-terminated destination buffers. Use
> strscpy() instead and remove the manual NUL-termination.
> 
> Compile-tested only.
> 
> Link: https://github.com/KSPP/linux/issues/90
> Cc: linux-hardening at vger.kernel.org
> Signed-off-by: Thorsten Blum <thorsten.blum at linux.dev>

Yup, the adapter var is already zeroed out, so even if NUL padding is
needed, it is already present.

Reviewed-by: Kees Cook <kees at kernel.org>

-- 
Kees Cook


More information about the dri-devel mailing list