mirror of
https://github.com/UberGames/lilium-voyager.git
synced 2024-11-10 06:31:47 +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;
|
||||
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);
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue