summaryrefslogtreecommitdiffstats
path: root/generic/tclUtil.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2011-06-01 12:06:54 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2011-06-01 12:06:54 (GMT)
commitab1ff5f9d6a78c586f81d6c274544cb5b4c45b92 (patch)
treee35c258218b20d4c29d1623b0ff5d5e64b7d8bed /generic/tclUtil.c
parent62704b0bfde72fbf8ffc6f2653b715346cf9e1c4 (diff)
downloadtcl-ab1ff5f9d6a78c586f81d6c274544cb5b4c45b92.zip
tcl-ab1ff5f9d6a78c586f81d6c274544cb5b4c45b92.tar.gz
tcl-ab1ff5f9d6a78c586f81d6c274544cb5b4c45b92.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 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 */