Skip to content

Commit

Permalink
src/libFLAC/stream_decoder.c : Fix buffer read overflow.
Browse files Browse the repository at this point in the history
This is CVE-2014-8962.

Reported-by: Michele Spagnuolo,
             Google Security Team <mikispag@google.com>
  • Loading branch information
erikd committed Nov 20, 2014
1 parent d8d1717 commit 5b3033a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/libFLAC/stream_decoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ FLAC_API int FLAC_API_SUPPORTS_OGG_FLAC =
*
***********************************************************************/

static FLAC__byte ID3V2_TAG_[3] = { 'I', 'D', '3' };
static const FLAC__byte ID3V2_TAG_[3] = { 'I', 'D', '3' };

/***********************************************************************
*
Expand Down Expand Up @@ -1361,6 +1361,10 @@ FLAC__bool find_metadata_(FLAC__StreamDecoder *decoder)
id = 0;
continue;
}

if(id >= 3)
return false;

if(x == ID3V2_TAG_[id]) {
id++;
i = 0;
Expand Down

0 comments on commit 5b3033a

Please sign in to comment.