diff options
| author | Justin Stitt <[email protected]> | 2023-09-14 21:30:37 +0000 |
|---|---|---|
| committer | Lyude Paul <[email protected]> | 2023-09-15 13:36:26 -0400 |
| commit | 3ce6608bfc84415414b61b05abcfb80d3d8f854d (patch) | |
| tree | b1343914da7d5b3d77193348a1d121fb19e6cd3e /tools/perf/scripts/python/check-perf-trace.py | |
| parent | db43b0319df5949286411e3f6ed225186f552297 (diff) | |
drm/nouveau/nvif: refactor deprecated strncpy
`strncpy` is deprecated and as such 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 also
maintaining the NUL-padding behavior that `strncpy` provides. I am not
sure whether NUL-padding is strictly needed but I see in
`nvif_object_ctor()` args is memcpy'd elsewhere so I figured we'd keep
the same functionality.
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: [email protected]
Signed-off-by: Justin Stitt <[email protected]>
Reviewed-by: Kees Cook <[email protected]>
Reviewed-by: Lyude Paul <[email protected]>
Signed-off-by: Lyude Paul <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/20230914-strncpy-drivers-gpu-drm-nouveau-nvif-client-c-v1-1-dc3b3719fcb4@google.com
Diffstat (limited to 'tools/perf/scripts/python/check-perf-trace.py')
0 files changed, 0 insertions, 0 deletions