diff options
| author | Andrey Zakharov <dedemorow@gmail.com> | 2026-10-23 13:50:27 +0300 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2026-10-23 21:34:09 +0200 |
| commit | e4a21e95c5577dda3a4049b8eb7f2df7d24b3134 (patch) | |
| tree | 831ac69153839b0a43ae6de415beeb662a78af62 /scripts/Makefile.thinlto | |
| parent | 0d01f90b07e877ef31f9959e9b0bc6bcca9b99df (diff) | |
| download | linux-e4a21e95c5577dda3a4049b8eb7f2df7d24b3134.tar.gz linux-e4a21e95c5577dda3a4049b8eb7f2df7d24b3134.zip | |
ALSA: emu10k1: Pass destination size to copy_string()
copy_string() copies the bus and input/output names into fixed-size
arrays of struct snd_emu10k1_fx8010_info using strcpy() and sprintf(),
and it has no information about the size of the destination buffer.
All source strings are static and shorter than the 32-byte destination
arrays (the longest one is 20 characters), so this is safe today, but the
safety should not depend on the contents of the name tables. The earlier
strcpy() to strscpy() conversions skipped this function because dst is a
plain pointer.
Pass the destination size to copy_string() and use strscpy() and
snprintf() instead.
No functional changes intended.
Testing: compile-tested only with clang (W=1) and sparse (C=1). The
function is reached only through the SNDRV_EMU10K1_IOCTL_INFO ioctl of
the EMU10K1 hardware, which is not available under QEMU.
Link: https://github.com/KSPP/linux/issues/88
Signed-off-by: Andrey Zakharov <dedemorow@gmail.com>
Link: https://patch.msgid.link/20261023105027.53135-1-dedemorow@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
