diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2013-01-04 14:38:37 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2013-01-04 14:38:37 (GMT) |
commit | 18d9d66f4d3a6a8b468474e25d5bacee500bda85 (patch) | |
tree | 709b0fa2e8d57aef2948a721b619752b157d6a4b /generic/tclCompCmdsSZ.c | |
parent | 09d1473b3be04898d6ec67abcad0b980fdd88df6 (diff) | |
download | tcl-18d9d66f4d3a6a8b468474e25d5bacee500bda85.zip tcl-18d9d66f4d3a6a8b468474e25d5bacee500bda85.tar.gz tcl-18d9d66f4d3a6a8b468474e25d5bacee500bda85.tar.bz2 |
Fix bad memory access problems found by Miguel Sofer when valgrinding.
Diffstat (limited to 'generic/tclCompCmdsSZ.c')
-rw-r--r-- | generic/tclCompCmdsSZ.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/generic/tclCompCmdsSZ.c b/generic/tclCompCmdsSZ.c index 7bead0d..1d04d8b 100644 --- a/generic/tclCompCmdsSZ.c +++ b/generic/tclCompCmdsSZ.c @@ -2737,7 +2737,7 @@ TclCompileUnsetCmd( flags = 1; varTokenPtr = TokenAfter(parsePtr->tokenPtr); leadingWord = Tcl_NewObj(); - if (TclWordKnownAtCompileTime(varTokenPtr, leadingWord)) { + if (numWords > 0 && TclWordKnownAtCompileTime(varTokenPtr, leadingWord)) { int len; const char *bytes = Tcl_GetStringFromObj(leadingWord, &len); |