diff --git a/include/asm/asm.h b/include/asm/asm.h index 1f70f6f7..609de1c0 100644 --- a/include/asm/asm.h +++ b/include/asm/asm.h @@ -30,6 +30,6 @@ extern struct sSymbol *pPCSymbol; extern bool oDontExpandStrings; #define MAXMACROARGS 256 -#define MAXINCPATHS 16 +#define MAXINCPATHS 128 #endif /* // ASM_H */ diff --git a/src/asm/fstack.c b/src/asm/fstack.c index 56fc46d0..27dde51b 100644 --- a/src/asm/fstack.c +++ b/src/asm/fstack.c @@ -179,6 +179,16 @@ fstk_Dump(void) void fstk_AddIncludePath(char *s) { + if (NextIncPath == MAXINCPATHS) { + fatalerror("Too many include directories passed from command line"); + return; + } + + if (strlen(s) > _MAX_PATH) { + fatalerror("Include path too long '%s'",s); + return; + } + strcpy(IncludePaths[NextIncPath++], s); }