Skip to content

Commit

Permalink
Fix potential buffer overflow in PS_ReadPrimitive
Browse files Browse the repository at this point in the history
Found by Coverity.
  • Loading branch information
zturtleman committed May 25, 2014
1 parent e21ff01 commit 078d004
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion code/botlib/l_script.c
Expand Up @@ -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;
Expand Down

0 comments on commit 078d004

Please sign in to comment.