summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2025-07-10 12:05:43 +0200
committerTakashi Iwai <tiwai@suse.de>2025-07-11 09:51:08 +0200
commit8bb0a5fcde7b424172e48cf2b85664e7fe201417 (patch)
tree8bf934c6dee53b48abd47c252781aa120436fb36
parent3829d81b6958632602bee7a8272005d1a4ce298f (diff)
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 <tiwai@suse.de> Link: https://patch.msgid.link/20250710100727.22653-2-tiwai@suse.de
-rw-r--r--sound/core/control.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/core/control.c b/sound/core/control.c
index 11f660fc6f2b..9c3fd5113a61 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;
}