From: Takashi Iwai Date: Thu, 10 Jul 2025 10:05:43 +0000 (+0200) Subject: ALSA: control: Use safer strscpy() instead of strcpy() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8bb0a5fcde7b424172e48cf2b85664e7fe201417;p=thirdparty%2Fkernel%2Flinux.git ALSA: control: Use safer strscpy() instead of strcpy() Use a safer function strscpy() instead of strcpy() for copying to arrays. Only idiomatic code replacement, and no functional changes. Signed-off-by: Takashi Iwai Link: https://patch.msgid.link/20250710100727.22653-2-tiwai@suse.de --- diff --git a/sound/core/control.c b/sound/core/control.c index 11f660fc6f2b5..9c3fd5113a617 100644 --- a/sound/core/control.c +++ b/sound/core/control.c @@ -1435,7 +1435,7 @@ static int snd_ctl_elem_user_enum_info(struct snd_kcontrol *kcontrol, names = ue->priv_data; for (; item > 0; --item) names += strlen(names) + 1; - strcpy(uinfo->value.enumerated.name, names); + strscpy(uinfo->value.enumerated.name, names); return 0; }