diff options
author | Justin Stitt <[email protected]> | 2023-08-07 17:49:28 +0000 |
---|---|---|
committer | Takashi Iwai <[email protected]> | 2023-08-08 14:46:11 +0200 |
commit | 3d28c466317b9515810a1f5ec29be394269bcb73 (patch) | |
tree | a0265e5e5c94b0c0706839b7a0f0c8890f457802 /scripts/gdb/linux/utils.py | |
parent | f95d5efa9f8a468051e20c349c2913720551dfa9 (diff) |
ALSA: hda/tegra: refactor deprecated strncpy
`strncpy` is deprecated for use on NUL-terminated destination strings [1].
A suitable replacement is `strscpy` [2] due to the fact that it
guarantees NUL-termination on its destination buffer argument which is
_not_ the case for `strncpy`!
It should be noted that the current implementation is unlikely to have a
bug because `drv_name` is a string literal with a size of 9 while
`card->driver` has a size of 16. However, it is probably worthwhile to
switch to a more robust and less ambiguous interface.
[1]: www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings
[2]: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html
Link: https://github.com/KSPP/linux/issues/90
Cc: [email protected]
Signed-off-by: Justin Stitt <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Takashi Iwai <[email protected]>
Diffstat (limited to 'scripts/gdb/linux/utils.py')
0 files changed, 0 insertions, 0 deletions