mirror of
https://github.com/UberGames/ioef.git
synced 2025-02-22 11:31:12 +00:00
Fix potential buffer overflow in PS_ReadPrimitive
Found by Coverity.
This commit is contained in:
parent
e21ff01946
commit
078d004dc2
1 changed files with 1 additions and 1 deletions
|
@ -828,7 +828,7 @@ int PS_ReadPrimitive(script_t *script, token_t *token)
|
||||||
len = 0;
|
len = 0;
|
||||||
while(*script->script_p > ' ' && *script->script_p != ';')
|
while(*script->script_p > ' ' && *script->script_p != ';')
|
||||||
{
|
{
|
||||||
if (len >= MAX_TOKEN)
|
if (len >= MAX_TOKEN - 1)
|
||||||
{
|
{
|
||||||
ScriptError(script, "primitive token longer than MAX_TOKEN = %d", MAX_TOKEN);
|
ScriptError(script, "primitive token longer than MAX_TOKEN = %d", MAX_TOKEN);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue