Merge pull request #845 from maraakate/master

Check >= maxsize in Info_SetValueForKey().  Found by ASAN.
This commit is contained in:
Yamagi 2022-05-28 11:42:00 +02:00 committed by GitHub
commit c1212875b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1398,7 +1398,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;