summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2023-03-20 18:45:28 (GMT)
committerdgp <dgp@users.sourceforge.net>2023-03-20 18:45:28 (GMT)
commit88f18252321544193f8c2aae0eb23f43da96968b (patch)
treedc1e743b379f6ce288ab26d64ba3a95fbd483168
parent8133df3b6d12fd4fa798c7917979517d34f97996 (diff)
downloadtcl-88f18252321544193f8c2aae0eb23f43da96968b.zip
tcl-88f18252321544193f8c2aae0eb23f43da96968b.tar.gz
tcl-88f18252321544193f8c2aae0eb23f43da96968b.tar.bz2
Candidate fix for [f3cb2a32d6]
Add initialization to allocation of string rep buffer to resolve valgrind reports on use of uninitialized memory
-rw-r--r--generic/tclStringObj.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c
index 328e410..322aed5 100644
--- a/generic/tclStringObj.c
+++ b/generic/tclStringObj.c
@@ -339,6 +339,7 @@ GrowStringBuffer(
}
objPtr->bytes = ptr;
stringPtr->allocated = attempt;
+ memset(ptr + objPtr->length, 0, attempt + 1U - objPtr->length);
}
static void