summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2017-02-27 14:52:13 (GMT)
committerdgp <dgp@users.sourceforge.net>2017-02-27 14:52:13 (GMT)
commitd45d73592afaa67ffcf16a040b152617657ff067 (patch)
treec8aefb01145e1e2e323fbf3edeec1408b3e4aafe
parent1609a65c29afebbca87366c03e2aed20468ca7e5 (diff)
parent11e95f1ff7b8996c35878bb283ee33e5c263c08c (diff)
downloadtcl-d45d73592afaa67ffcf16a040b152617657ff067.zip
tcl-d45d73592afaa67ffcf16a040b152617657ff067.tar.gz
tcl-d45d73592afaa67ffcf16a040b152617657ff067.tar.bz2
ParseTokens failed to fully respect its numBytes argument.
-rw-r--r--generic/tclParse.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/generic/tclParse.c b/generic/tclParse.c
index 95abc45..fe3ccab 100644
--- a/generic/tclParse.c
+++ b/generic/tclParse.c
@@ -1193,6 +1193,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;
@@ -1201,8 +1203,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);
/*