summaryrefslogtreecommitdiffstats
path: root/generic/tclUtil.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2011-06-01 12:09:09 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2011-06-01 12:09:09 (GMT)
commitffdd191a57e3105fd2a4702b0c2496b83c9e0637 (patch)
treefb755d548645c07cd9eb8e543777ac769deab746 /generic/tclUtil.c
parent9d5b29a8051a1ca0b93a8fcdb7058920dad2a883 (diff)
parentab1ff5f9d6a78c586f81d6c274544cb5b4c45b92 (diff)
downloadtcl-ffdd191a57e3105fd2a4702b0c2496b83c9e0637.zip
tcl-ffdd191a57e3105fd2a4702b0c2496b83c9e0637.tar.gz
tcl-ffdd191a57e3105fd2a4702b0c2496b83c9e0637.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 */