Fix BSP reader crashing the server, again.
This commit is contained in:
@@ -421,7 +421,11 @@ skipspace:
|
||||
if (script->script_p == script->end_p)
|
||||
break;
|
||||
if (token_p == &token[MAXTOKEN])
|
||||
LOG_MESSAGE(PLID, "Token too large on line %i", scriptline);
|
||||
{
|
||||
// if the server does not crash before this happens, then monstermod will.
|
||||
// simulate a fatal error and be verbose on why it happens.
|
||||
ALERT(at_logged, "FATAL ERROR (shutting down): ReadEntsFromBSP: Line %i is too long (length > %i).", scriptline, MAXTOKEN);
|
||||
}
|
||||
}
|
||||
script->script_p++;
|
||||
}
|
||||
@@ -432,7 +436,10 @@ skipspace:
|
||||
if (script->script_p == script->end_p)
|
||||
break;
|
||||
if (token_p == &token[MAXTOKEN])
|
||||
LOG_MESSAGE(PLID, "Token too large on line %i", scriptline);
|
||||
{
|
||||
// ditto
|
||||
ALERT(at_logged, "FATAL ERROR (shutting down): ReadEntsFromBSP: Line %i is too long (length > %i).", scriptline, MAXTOKEN);
|
||||
}
|
||||
}
|
||||
|
||||
*token_p = 0;
|
||||
|
||||
@@ -90,7 +90,7 @@ void SafeRead(FILE *f, void *buffer, int count);
|
||||
char *ExpandPath(char *path); // from scripts
|
||||
|
||||
// -- scriplib.h --
|
||||
#define MAXTOKEN 512
|
||||
#define MAXTOKEN 4096
|
||||
|
||||
extern char token[MAXTOKEN];
|
||||
bool GetToken(bool crossline);
|
||||
|
||||
Reference in New Issue
Block a user