Fix potential buffer overflow in PS_ReadPrimitive

Found by Coverity.
This commit is contained in:
Zack Middleton committed 2014-05-25 16:28:38 -05:00
1 parent e21ff01946
commit 078d004dc2
1 file changed
+1 -1
+1 -1
View File
@@ -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;