From: Takashi Iwai Date: Fri, 29 Feb 2008 13:16:17 +0000 (+0100) Subject: [ALSA] hda-codec - Fix the array over-range access with stac92hd71bxx codec X-Git-Tag: v2.6.26-rc1~1087^2~158 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=40ac8c4f208111cdc1542ccc9feb21b98a6b0219;p=linux-2.6 [ALSA] hda-codec - Fix the array over-range access with stac92hd71bxx codec Add the check of the array range for dac_nids to prevent the over-range access. Signed-off-by: Takashi Iwai --- diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index f6c02c0b1f..6c85e7e810 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c @@ -2363,7 +2363,7 @@ static int stac92xx_auto_create_multi_out_ctls(struct hda_codec *codec, unsigned int wid_caps, pincap; - for (i = 0; i < cfg->line_outs; i++) { + for (i = 0; i < cfg->line_outs && i < spec->multiout.num_dacs; i++) { if (!spec->multiout.dac_nids[i]) continue;