]> git.ipfire.org Git - thirdparty/linux.git/commit
ALSA: core: Copy string more safely
authorTakashi Iwai <tiwai@suse.de>
Thu, 10 Jul 2025 10:07:25 +0000 (12:07 +0200)
committerTakashi Iwai <tiwai@suse.de>
Fri, 11 Jul 2025 07:53:36 +0000 (09:53 +0200)
commitbee60f019606827363d7e355b2e859e29e928c3a
treec87db59703bd97a757f4df489800954c98b19e24
parent53beb4d0ed8f9bf31ba30e65953abb473b191bd0
ALSA: core: Copy string more safely

Replace the remaining strcpy() and sprintf() usages in the ALSA core
code with the safer versions.

The first strcpy() points actually to card->id, hence just use
strscpy() with card->id instead.

The append of suffix string is slightly rewritten so that we can use
scnprintf() and strscpy().

Only for safety, no actual behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250710100727.22653-104-tiwai@suse.de
sound/core/init.c