diff options
author | dgp <dgp@users.sourceforge.net> | 2017-02-27 14:53:32 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2017-02-27 14:53:32 (GMT) |
commit | 838c36a45d377ef799dd45158832040a6a528d91 (patch) | |
tree | 6cd8886592e0eb1bd1d75421800fc4757e64075a /generic | |
parent | c8c30d6dacd71f453e3bfb95c66cbee3df3468e0 (diff) | |
parent | d45d73592afaa67ffcf16a040b152617657ff067 (diff) | |
download | tcl-838c36a45d377ef799dd45158832040a6a528d91.zip tcl-838c36a45d377ef799dd45158832040a6a528d91.tar.gz tcl-838c36a45d377ef799dd45158832040a6a528d91.tar.bz2 |
ParseTokens failed to fully respect its numBytes argument.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclParse.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/generic/tclParse.c b/generic/tclParse.c index 3a04df4..9b801a3 100644 --- a/generic/tclParse.c +++ b/generic/tclParse.c @@ -1169,6 +1169,8 @@ ParseTokens( numBytes--; nestedPtr = TclStackAlloc(parsePtr->interp, sizeof(Tcl_Parse)); while (1) { + const char *curEnd; + if (Tcl_ParseCommand(parsePtr->interp, src, numBytes, 1, nestedPtr) != TCL_OK) { parsePtr->errorType = nestedPtr->errorType; @@ -1177,8 +1179,9 @@ ParseTokens( TclStackFree(parsePtr->interp, nestedPtr); return TCL_ERROR; } + curEnd = src + numBytes; src = nestedPtr->commandStart + nestedPtr->commandSize; - numBytes = parsePtr->end - src; + numBytes = curEnd - src; Tcl_FreeParse(nestedPtr); /* |