Skip to content

Commit dee76c9

Browse files
author
Timothy B. Terriberry
committed
Fix out-of-bounds read in serialno matching logic
We very carefully ensured _cur_link + 1 was in bounds, and then dereferenced nlinks + 1 (guaranteed to be out of bounds) instead. Introduced in commit f83675e. Thanks to the Google Autfuzz project for the report. Fixes #2326
1 parent 2c239eb commit dee76c9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/opusfile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1835,7 +1835,7 @@ static int op_get_link_from_serialno(const OggOpusFile *_of,int _cur_link,
18351835
nlinks=_of->nlinks;
18361836
li_lo=0;
18371837
/*Start off by guessing we're just a multiplexed page in the current link.*/
1838-
li_hi=_cur_link+1<nlinks&&_page_offset<links[nlinks+1].offset?
1838+
li_hi=_cur_link+1<nlinks&&_page_offset<links[_cur_link+1].offset?
18391839
_cur_link+1:nlinks;
18401840
do{
18411841
if(_page_offset>=links[_cur_link].offset)li_lo=_cur_link;

0 commit comments

Comments
 (0)