From: Alexander Stein Date: Tue, 1 Nov 2011 08:40:07 +0000 (+0100) Subject: ALSA: hda_hwdep: Fix possible buffer overflow X-Git-Tag: v3.2-rc1~38^2~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=359f90982cba0ba8db39b683de05dcb2de64b979;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git ALSA: hda_hwdep: Fix possible buffer overflow If a line in the firmware file is larger than the given buffer size (and so the firmware file size), size is set to a value larger than the actual buffer size. This results in an overflow in the buffer passed. Signed-off-by: Alexander Stein Signed-off-by: Takashi Iwai --- diff --git a/sound/pci/hda/hda_hwdep.c b/sound/pci/hda/hda_hwdep.c index 72e5885..7e7d078 100644 --- a/sound/pci/hda/hda_hwdep.c +++ b/sound/pci/hda/hda_hwdep.c @@ -756,8 +756,6 @@ static int get_line_from_fw(char *buf, int size, struct firmware *fw) } if (!fw->size) return 0; - if (size < fw->size) - size = fw->size; for (len = 0; len < fw->size; len++) { if (!*p)