From ef7f989da6fc3e3ee12ea4143a99d2ec022f8f72 Mon Sep 17 00:00:00 2001 From: "Darryl L. Miles" Date: Wed, 16 Oct 2024 10:20:09 +0100 Subject: [PATCH] grTCairo1.c: GrTCairoIconUpdate() 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/grTCairo1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphics/grTCairo1.c b/graphics/grTCairo1.c index bdb2bff3..d0e1f2d5 100644 --- a/graphics/grTCairo1.c +++ b/graphics/grTCairo1.c @@ -1490,7 +1490,7 @@ char *text; XSetClassHint( grXdpy, wind, &class); if (text) { - if ((brack = strchr(text, '['))) + if ((brack = strchr(text, '[')) && brack != text) { brack--; *brack = 0;