From 26b871955051d6c4b12e583557b08153431df38e Mon Sep 17 00:00:00 2001 From: razor Date: Sat, 30 Sep 2023 17:45:32 +1000 Subject: [PATCH] [MP] fix off-by-one in TruncateGLExtensionsString which affects mods 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 --- codemp/rd-vanilla/tr_init.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codemp/rd-vanilla/tr_init.cpp b/codemp/rd-vanilla/tr_init.cpp index 2fb27a4401..847bae6257 100644 --- a/codemp/rd-vanilla/tr_init.cpp +++ b/codemp/rd-vanilla/tr_init.cpp @@ -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++;