Skip to content

Commit

Permalink
ALSA: hda_hwdep: Fix possible buffer overflow
Browse files Browse the repository at this point in the history
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 <alexander.stein@systec-electronic.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Alexander Stein authored and Takashi Iwai committed Nov 1, 2011
1 parent 228cf79 commit 359f909
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions sound/pci/hda/hda_hwdep.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 359f909

Please sign in to comment.