diff options
author | Takashi Iwai <tiwai@suse.de> | 2013-10-28 09:21:46 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-10-31 13:57:47 -0400 |
commit | a19685cb72bb6a80ac453e76b3ab3bb7770e1742 (patch) | |
tree | 54d0e30193d6251517a7b1d474533b9d741edcca /sound/soc/soc-core.c | |
parent | 6833c452c2fb47353566aa705d68541c6045c796 (diff) |
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: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r-- | sound/soc/soc-core.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 0860a7f11299..b38e0ee622df 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -2552,8 +2552,9 @@ int snd_soc_info_enum_double(struct snd_kcontrol *kcontrol, | |||
2552 | 2552 | ||
2553 | if (uinfo->value.enumerated.item > e->max - 1) | 2553 | if (uinfo->value.enumerated.item > e->max - 1) |
2554 | uinfo->value.enumerated.item = e->max - 1; | 2554 | uinfo->value.enumerated.item = e->max - 1; |
2555 | strcpy(uinfo->value.enumerated.name, | 2555 | strlcpy(uinfo->value.enumerated.name, |
2556 | e->texts[uinfo->value.enumerated.item]); | 2556 | e->texts[uinfo->value.enumerated.item], |
2557 | sizeof(uinfo->value.enumerated.name)); | ||
2557 | return 0; | 2558 | return 0; |
2558 | } | 2559 | } |
2559 | EXPORT_SYMBOL_GPL(snd_soc_info_enum_double); | 2560 | EXPORT_SYMBOL_GPL(snd_soc_info_enum_double); |