Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 359f9098 authored by Alexander Stein's avatar Alexander Stein Committed by Takashi Iwai
Browse files

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: default avatarAlexander Stein <alexander.stein@systec-electronic.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 228cf793
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -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)