summaryrefslogtreecommitdiffstats
path: root/generic/tclUtil.c
diff options
context:
space:
mode:
authornijtmans@users.sourceforge.net <jan.nijtmans>2011-06-01 12:09:09 (GMT)
committernijtmans@users.sourceforge.net <jan.nijtmans>2011-06-01 12:09:09 (GMT)
commit4f75e5f1912de1efff40e7f97c46f822d3096b4c (patch)
treefb755d548645c07cd9eb8e543777ac769deab746 /generic/tclUtil.c
parenta8503e904eb205db71a253e152a2394e1039c400 (diff)
parentdd38c6bae00bf1fe4b756e575cec406d1c0ee08f (diff)
downloadtcl-4f75e5f1912de1efff40e7f97c46f822d3096b4c.zip
tcl-4f75e5f1912de1efff40e7f97c46f822d3096b4c.tar.gz
tcl-4f75e5f1912de1efff40e7f97c46f822d3096b4c.tar.bz2
fix for [Bug 3309871]: Valgrind finds: invalid read in TclMaxListLength()
Diffstat (limited to 'generic/tclUtil.c')
-rw-r--r--generic/tclUtil.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/generic/tclUtil.c b/generic/tclUtil.c
index ce66096..f424381 100644
--- a/generic/tclUtil.c
+++ b/generic/tclUtil.c
@@ -408,8 +408,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 */