Skip to content

Commit

Permalink
fix vulnerability where an atom list size is enormous
Browse files Browse the repository at this point in the history
and calculating the number of bytes needed to hold the list overflows

Addresses https://nvd.nist.gov/vuln/detail/CVE-2018-14326 and https://nvd.nist.gov/vuln/detail/CVE-2018-14446
  • Loading branch information
TomSirgedas authored and daveorourke committed Mar 20, 2019
1 parent e475013 commit 70d823c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/mp4array.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ class MP4Array {
void Resize(MP4ArrayIndex newSize) { \
m_numElements = newSize; \
m_maxNumElements = newSize; \
if ( (uint64_t) m_maxNumElements * sizeof(type) > 0xFFFFFFFF ) \
throw new PlatformException("requested array size exceeds 4GB", ERANGE, __FILE__, __LINE__, __FUNCTION__); /* prevent overflow */ \
m_elements = (type*)MP4Realloc(m_elements, \
m_maxNumElements * sizeof(type)); \
} \
Expand Down

0 comments on commit 70d823c

Please sign in to comment.