summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorapnadkarni <apnmbx-wits@yahoo.com>2023-09-25 18:44:45 (GMT)
committerapnadkarni <apnmbx-wits@yahoo.com>2023-09-25 18:44:45 (GMT)
commitd3ec5a1fb59c1b5e51d4492e69d5205300e3f2e8 (patch)
treea04dc1ab72ddeadf109945c633caffa75177fb29
parent1a4b2a056ce67074301ca31b34e72f174b233403 (diff)
downloadtcl-d3ec5a1fb59c1b5e51d4492e69d5205300e3f2e8.zip
tcl-d3ec5a1fb59c1b5e51d4492e69d5205300e3f2e8.tar.gz
tcl-d3ec5a1fb59c1b5e51d4492e69d5205300e3f2e8.tar.bz2
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]; | ^~~~~~~~~
-rw-r--r--generic/tclObj.c2
1 files changed, 1 insertions, 1 deletions
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".
*/