提交 a19685cb 编写于 作者: T Takashi Iwai 提交者: Mark Brown

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: NTakashi Iwai <tiwai@suse.de>
Signed-off-by: NMark Brown <broonie@linaro.org>
上级 6833c452
...@@ -2552,8 +2552,9 @@ int snd_soc_info_enum_double(struct snd_kcontrol *kcontrol, ...@@ -2552,8 +2552,9 @@ int snd_soc_info_enum_double(struct snd_kcontrol *kcontrol,
if (uinfo->value.enumerated.item > e->max - 1) if (uinfo->value.enumerated.item > e->max - 1)
uinfo->value.enumerated.item = e->max - 1; uinfo->value.enumerated.item = e->max - 1;
strcpy(uinfo->value.enumerated.name, strlcpy(uinfo->value.enumerated.name,
e->texts[uinfo->value.enumerated.item]); e->texts[uinfo->value.enumerated.item],
sizeof(uinfo->value.enumerated.name));
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(snd_soc_info_enum_double); EXPORT_SYMBOL_GPL(snd_soc_info_enum_double);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册