Commit 939fcf7b authored by Justin Stitt's avatar Justin Stitt Committed by Lucas Stach
Browse files

drm/etnaviv: Replace strncpy with strscpy_pad

`strncpy` is deprecated for use on NUL-terminated destination strings [1].

We should prefer more robust and less ambiguous string interfaces.

A suitable replacement is `strscpy_pad` due to the fact that it
guarantees NUL-termination on the destination buffer whilst maintaining
the NUL-padding behavior that strncpy provides.

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
Cc: Bo YU <tsu.yubo@gmail.com>
Signed-off-by: default avatarJustin Stitt <justinstitt@google.com>
Reviewed-by: default avatarKees Cook <keescook@chromium.org>
Reviewed-by: default avatarChristian Gmeiner <cgmeiner@igalia.com>
[lst: changed subject according to suggestion from Kees]
Signed-off-by: default avatarLucas Stach <l.stach@pengutronix.de>
parent 0bb80ecc
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment