From ed0b80a3d44136d573b2e28d2c0b4d5a64944e0a Mon Sep 17 00:00:00 2001 From: maraakate Date: Sun, 29 May 2022 15:57:52 +0300 Subject: [PATCH] src/common/shared.c: Check >= maxsize in Info_SetValueForKey(). Found by ASAN. --- src/common/shared.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/shared.c b/src/common/shared.c index e4e2c78..645b889 100644 --- a/src/common/shared.c +++ b/src/common/shared.c @@ -1394,7 +1394,7 @@ Info_SetValueForKey(char *s, char *key, char *value) Com_sprintf(newi, sizeof(newi), "\\%s\\%s", key, value); - if (strlen(newi) + strlen(s) > maxsize) + if (strlen(newi) + strlen(s) >= maxsize) { Com_Printf("Info string length exceeded\n"); return;