From d3ec5a1fb59c1b5e51d4492e69d5205300e3f2e8 Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Mon, 25 Sep 2023 18:44:45 +0000 Subject: Fix (actually benign) gcc warning below about writing past array bound. D:/src/tcltk/wip/tcl/generic/tclObj.c: In function 'ParseBoolean': D:/src/tcltk/wip/tcl/generic/tclObj.c:2329:23: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=] 2329 | lowerCase[length] = 0; | ~~~~~~~~~~~~~~~~~~^~~ D:/src/tcltk/wip/tcl/generic/tclObj.c:2281:10: note: at offset [-2147483648, -1] into destination object 'lowerCas ' of size 6 2281 | char lowerCase[6]; | ^~~~~~~~~ --- generic/tclObj.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tclObj.c b/generic/tclObj.c index b999540..321b100 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.c @@ -2282,7 +2282,7 @@ ParseBoolean( Tcl_Size i, length; const char *str = Tcl_GetStringFromObj(objPtr, &length); - if ((length == 0) || (length > 5)) { + if ((length <= 0) || (length > 5)) { /* * Longest valid boolean string rep. is "false". */ -- cgit v0.12