Commit 4b35d2ca authored by Roel Kluin's avatar Roel Kluin Committed by Takashi Iwai

ALSA: hda - Read buffer overflow

Check whether index is within bounds before testing the element.
Signed-off-by: default avatarRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 84d3dc20
...@@ -559,7 +559,7 @@ static int alc_pin_mode_get(struct snd_kcontrol *kcontrol, ...@@ -559,7 +559,7 @@ static int alc_pin_mode_get(struct snd_kcontrol *kcontrol,
/* Find enumerated value for current pinctl setting */ /* Find enumerated value for current pinctl setting */
i = alc_pin_mode_min(dir); i = alc_pin_mode_min(dir);
while (alc_pin_mode_values[i] != pinctl && i <= alc_pin_mode_max(dir)) while (i <= alc_pin_mode_max(dir) && alc_pin_mode_values[i] != pinctl)
i++; i++;
*valp = i <= alc_pin_mode_max(dir) ? i: alc_pin_mode_min(dir); *valp = i <= alc_pin_mode_max(dir) ? i: alc_pin_mode_min(dir);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment