diff options
| author | nijtmans@users.sourceforge.net <jan.nijtmans> | 2011-06-01 12:06:54 (GMT) |
|---|---|---|
| committer | nijtmans@users.sourceforge.net <jan.nijtmans> | 2011-06-01 12:06:54 (GMT) |
| commit | dd38c6bae00bf1fe4b756e575cec406d1c0ee08f (patch) | |
| tree | e35c258218b20d4c29d1623b0ff5d5e64b7d8bed /generic/tclUtil.c | |
| parent | 42c31d07397063acca8e6d97a48105086604cb71 (diff) | |
| download | tcl-dd38c6bae00bf1fe4b756e575cec406d1c0ee08f.zip tcl-dd38c6bae00bf1fe4b756e575cec406d1c0ee08f.tar.gz tcl-dd38c6bae00bf1fe4b756e575cec406d1c0ee08f.tar.bz2 | |
fix for [Bug 3309871]: Valgrind finds: invalid read in TclMaxListLength()
Diffstat (limited to 'generic/tclUtil.c')
| -rw-r--r-- | generic/tclUtil.c | 4 |
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 */ |
