Skip to content

Commit

Permalink
stb_vorbis: fix CVE-2023-45681 (integer overflow.)
Browse files Browse the repository at this point in the history
Based on patch by Jaroslav Lobačevski (@JarLob) submitted to
mainstream at nothings/stb#1559

GHSL-2023-171/CVE-2023-45681: Out of bounds heap buffer write
  • Loading branch information
sezero committed Dec 11, 2023
1 parent 09996c4 commit f04567f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/stb_vorbis.h
Original file line number Diff line number Diff line change
Expand Up @@ -3747,9 +3747,12 @@ static int start_decoder(vorb *f)
f->comment_list = NULL;
if (f->comment_list_length > 0)
{
if (INT_MAX / sizeof(char*) < f->comment_list_length)
goto no_comment;
len = sizeof(char*) * f->comment_list_length;
f->comment_list = (char**) setup_malloc(f, len);
if (f->comment_list == NULL) {
no_comment:
f->comment_list_length = 0;
return error(f, VORBIS_outofmem);
}
Expand Down

0 comments on commit f04567f

Please sign in to comment.