Skip to content

Commit 4f50d4a

Browse files
Volker Rümelinkraxel
authored andcommitted
ossaudio: fix out of bounds write
In function oss_read() a read error currently does not exit the read loop. With no data to read the variable pos will quickly underflow and a subsequent successful read overwrites memory outside the buffer. This patch adds the missing break statement to the error path of the function. To reproduce start qemu with -audiodev oss,id=audio0 and in the guest start audio recording. After some time this will trigger an exception. Fixes: 3ba4066 "ossaudio: port to the new audio backend api" Signed-off-by: Volker Rümelin <[email protected]> Message-id: [email protected] Signed-off-by: Gerd Hoffmann <[email protected]>
1 parent 9f526fc commit 4f50d4a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

audio/ossaudio.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,7 @@ static size_t oss_read(HWVoiceIn *hw, void *buf, size_t len)
691691
len, dst);
692692
break;
693693
}
694+
break;
694695
}
695696

696697
pos += nread;

0 commit comments

Comments
 (0)