Skip to content

Commit

Permalink
[MP] fix off-by-one in TruncateGLExtensionsString which affects mods …
Browse files Browse the repository at this point in the history
…not derived from OJK (#1175)

UI_DrawGLInfo has an array of size 128, which was being filled from a GL extensions string of 129 words and displaying garbage in the UI.
Ref #472
  • Loading branch information
Razish committed Sep 30, 2023
1 parent 61b6023 commit 26b8719
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion codemp/rd-vanilla/tr_init.cpp
Expand Up @@ -751,7 +751,7 @@ static const char *TruncateGLExtensionsString (const char *extensionsString, int

char *truncatedExtensions;

while ( (q = strchr (p, ' ')) != NULL && numExtensions <= maxExtensions )
while ( (q = strchr (p, ' ')) != NULL && numExtensions < maxExtensions )
{
p = q + 1;
numExtensions++;
Expand Down

0 comments on commit 26b8719

Please sign in to comment.