Skip to content

Commit

Permalink
Fix heap buffer overflow in MXM loader
Browse files Browse the repository at this point in the history
See issue #35.

Fixes id_000089,sig_06,src_000041,op_havoc,rep_64
  • Loading branch information
sagamusix authored and Deltafire committed Oct 17, 2017
1 parent a8babe6 commit 40e0126
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/milkyplay/LoaderMXM.cpp
Expand Up @@ -189,7 +189,11 @@ mp_sint32 LoaderMXM::load(XMFileBase& f, XModule* module)
MXMHeader.samples16 = f.readDword();
MXMHeader.lowpitch = f.readDword();
MXMHeader.highpitch = f.readDword();
f.read(MXMHeader.panpos,1,32);

if(MXMHeader.ordnum > 256 || MXMHeader.patnum > 256 || MXMHeader.insnum > 256)
return MP_LOADER_FAILED;

f.read(MXMHeader.panpos,1,32);

f.read(&header->ord, 1, 256);

Expand Down

0 comments on commit 40e0126

Please sign in to comment.