Skip to content

Commit

Permalink
load_it.c (IT_ReadPattern): make sure that itnote pointer is in range.
Browse files Browse the repository at this point in the history
fixes last of the IT fuzzing crasher provided by Lionel Debroux. (id
number 162.)
  • Loading branch information
sezero committed Mar 25, 2017
1 parent 98f1f0c commit 1c8dfd0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libmikmod/loaders/load_it.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ static BOOL IT_ReadPattern(UWORD patrows)
int row=0,flag,ch;
unsigned int blah;
ITNOTE *itt=itpat,dummy,*n,*l;
ITNOTE *ite=&itpat[200*64 -1];
UBYTE *m;

memset(itt,255,200*64*sizeof(ITNOTE));
Expand All @@ -353,6 +354,10 @@ static BOOL IT_ReadPattern(UWORD patrows)
n=&itt[ch];
l=&last[ch];
m=&mask[ch];
if(n > ite) { /* malformed file */
_mm_errno = MMERR_NOT_A_MODULE;
return 0;
}
} else
{
n=l=&dummy;
Expand Down

0 comments on commit 1c8dfd0

Please sign in to comment.