summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <jan.nijtmans@noemail.net>2011-06-01 12:06:54 (GMT)
committerjan.nijtmans <jan.nijtmans@noemail.net>2011-06-01 12:06:54 (GMT)
commit59a99582fb97cf546841e80c9ad392f47fb3ab92 (patch)
treee35c258218b20d4c29d1623b0ff5d5e64b7d8bed /generic
parent3672eb57b364d4dda069e60510c91f090beefff0 (diff)
downloadtcl-59a99582fb97cf546841e80c9ad392f47fb3ab92.zip
tcl-59a99582fb97cf546841e80c9ad392f47fb3ab92.tar.gz
tcl-59a99582fb97cf546841e80c9ad392f47fb3ab92.tar.bz2
fix for [Bug 3309871]: Valgrind finds: invalid read in TclMaxListLength()
FossilOrigin-Name: 522bbc6851eb680b7a9b480e3edbabadc8a7a751
Diffstat (limited to 'generic')
-rw-r--r--generic/tclUtil.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/generic/tclUtil.c b/generic/tclUtil.c
index b00489d..9a23291 100644
--- a/generic/tclUtil.c
+++ b/generic/tclUtil.c
@@ -409,8 +409,8 @@ TclMaxListLength(
do {
bytes++;
numBytes -= (numBytes != -1);
- } while (numBytes && TclIsSpaceProc(*bytes));
- if (numBytes == 0) {
+ } while (numBytes && (*bytes != '\0') && TclIsSpaceProc(*bytes));
+ if ((numBytes == 0) || (*bytes == '\0')) {
break;
}
/* (*bytes) is non-space; return to counting state */