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.depull/476/head
parent
3829d81b69
commit
8bb0a5fcde
|
|
@ -1435,7 +1435,7 @@ static int snd_ctl_elem_user_enum_info(struct snd_kcontrol *kcontrol,
|
||||||
names = ue->priv_data;
|
names = ue->priv_data;
|
||||||
for (; item > 0; --item)
|
for (; item > 0; --item)
|
||||||
names += strlen(names) + 1;
|
names += strlen(names) + 1;
|
||||||
strcpy(uinfo->value.enumerated.name, names);
|
strscpy(uinfo->value.enumerated.name, names);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue