Add assertion to symFindMacroArg() to debug oob array access

This commit is contained in:
Christophe Staïesse
2014-10-05 16:36:57 +02:00
parent 00de7674af
commit 6758387668

View File

@@ -5,6 +5,7 @@
*
*/
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
@@ -431,6 +432,8 @@ sym_FindMacroArg(SLONG i)
if (i == -1)
i = MAXMACROARGS + 1;
assert(i-1 >= 0 &&
i-1 < sizeof(currentmacroargs)/sizeof(*currentmacroargs));
return (currentmacroargs[i - 1]);
}