浏览代码

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 <alexander.stein@systec-electronic.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Alexander Stein 13 年之前
父节点
当前提交
359f90982c
共有 1 个文件被更改,包括 0 次插入2 次删除
  1. 0 2
      sound/pci/hda/hda_hwdep.c

+ 0 - 2
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)