src/common/shared.c: Check >= maxsize in Info_SetValueForKey(). Found by ASAN.

This commit is contained in:
maraakate 2022-05-29 15:57:52 +03:00 committed by Denis Pauk
parent d134f46b59
commit ed0b80a3d4

View file

@ -1394,7 +1394,7 @@ Info_SetValueForKey(char *s, char *key, char *value)
Com_sprintf(newi, sizeof(newi), "\\%s\\%s", key, 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"); Com_Printf("Info string length exceeded\n");
return; return;