From 3a35d4d28dd780ba89bad5a30a69de8963159154 Mon Sep 17 00:00:00 2001 From: "Darryl L. Miles" Date: Wed, 16 Oct 2024 10:21:53 +0100 Subject: [PATCH] grTOGL1.c: GrTOGLIconUpdate() potential -1 out-of-bound access SonarCloud Access of 'char' element in the region at index -1 This was not picked up, even though similar code was. --- graphics/grTOGL1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphics/grTOGL1.c b/graphics/grTOGL1.c index 400878b8..c518bb55 100644 --- a/graphics/grTOGL1.c +++ b/graphics/grTOGL1.c @@ -1539,7 +1539,7 @@ GrTOGLIconUpdate(w,text) /* See Blt code */ XSetClassHint( grXdpy, wind, &class); if (text) { - if ((brack = strchr(text,'['))) + if ((brack = strchr(text,'[')) && brack != text) { brack--; *brack = 0;