You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix multiple heap-based buffer overflows in CmtkLoader::load()
Changes in src/mtk.cpp for loading files:
* Fail early if the (decompressed) size is too small to hold
mtkdata minus patterns. That avoids attempts to copy data
from beyond allocated memory.
* In the data decompression section, there are multiple cases
where the code actually has checks for available space before
copying data, but the size of the copy is increased after
the check, so a buffer overflow is still possible (issue adplug#90).
Fix that by moving the check after the size computation,
and also check for a valid source offset where applicable.
* Also add several checks whether source data is exhausted
during decompession, so
* When copying the patterns, don't copy more data than the
"pattern" array can hold.
In src/mtk.h, method getinstrument(), check for valid instrument
number to avoid accessing the array with an invalid index.
This commit fixes CVE-2019-14734.
Fixes: adplug#90
0 commit comments