Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a19685cb authored by Takashi Iwai's avatar Takashi Iwai Committed by Mark Brown
Browse files

ASoC: Use strlcpy() for copying in snd_soc_info_enum_double()



The provided texts aren't guaranteed to be in the fixed size.
Spotted by coverity CID 139318.

Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 6833c452
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -2552,8 +2552,9 @@ int snd_soc_info_enum_double(struct snd_kcontrol *kcontrol,

	if (uinfo->value.enumerated.item > e->max - 1)
		uinfo->value.enumerated.item = e->max - 1;
	strcpy(uinfo->value.enumerated.name,
		e->texts[uinfo->value.enumerated.item]);
	strlcpy(uinfo->value.enumerated.name,
		e->texts[uinfo->value.enumerated.item],
		sizeof(uinfo->value.enumerated.name));
	return 0;
}
EXPORT_SYMBOL_GPL(snd_soc_info_enum_double);