mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-22 20:51:31 +00:00
Merge pull request #1043 from mjunix/master-1
Fix potential index out of bounds
This commit is contained in:
commit
d466b8cf51
1 changed files with 2 additions and 2 deletions
|
@ -1131,7 +1131,7 @@ SCR_ExecuteLayoutString(char *s)
|
|||
token = COM_Parse(&s);
|
||||
index = (int)strtol(token, (char **)NULL, 10);
|
||||
|
||||
if ((index < 0) || (index >= sizeof(cl.frame.playerstate.stats)))
|
||||
if ((index < 0) || (index >= MAX_STATS))
|
||||
{
|
||||
Com_Error(ERR_DROP, "bad stats index %d (0x%x)", index, index);
|
||||
}
|
||||
|
@ -1358,7 +1358,7 @@ SCR_ExecuteLayoutString(char *s)
|
|||
token = COM_Parse(&s);
|
||||
index = (int)strtol(token, (char **)NULL, 10);
|
||||
|
||||
if ((index < 0) || (index >= MAX_CONFIGSTRINGS))
|
||||
if ((index < 0) || (index >= MAX_STATS))
|
||||
{
|
||||
Com_Error(ERR_DROP, "Bad stat_string index");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue