From 9c929ab4632b2f8a1d0f5dfa6fe4fc773870bc7e Mon Sep 17 00:00:00 2001 From: Johan Mattsson <39247600+mjunix@users.noreply.github.com> Date: Sun, 13 Aug 2023 18:04:04 +0200 Subject: [PATCH] Fix potential index out of bounds --- src/client/cl_screen.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/cl_screen.c b/src/client/cl_screen.c index ac2ff741..81cc9efe 100644 --- a/src/client/cl_screen.c +++ b/src/client/cl_screen.c @@ -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"); }