summaryrefslogtreecommitdiffstats
path: root/generic/tclParse.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2017-02-27 14:51:15 (GMT)
committerdgp <dgp@users.sourceforge.net>2017-02-27 14:51:15 (GMT)
commit11e95f1ff7b8996c35878bb283ee33e5c263c08c (patch)
treef0d20852ef89759b1637c961ecfdbb7e07222839 /generic/tclParse.c
parent304de510732b5bf301c6d97ca26f876dca26886e (diff)
downloadtcl-11e95f1ff7b8996c35878bb283ee33e5c263c08c.zip
tcl-11e95f1ff7b8996c35878bb283ee33e5c263c08c.tar.gz
tcl-11e95f1ff7b8996c35878bb283ee33e5c263c08c.tar.bz2
ParseTokens failed to fully respect its numBytes argument.
Diffstat (limited to 'generic/tclParse.c')
-rw-r--r--generic/tclParse.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/generic/tclParse.c b/generic/tclParse.c
index b40b636..6f989d9 100644
--- a/generic/tclParse.c
+++ b/generic/tclParse.c
@@ -1190,6 +1190,8 @@ ParseTokens(
nestedPtr = (Tcl_Parse *)
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;
@@ -1198,8 +1200,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);
/*