summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-01-13 13:23:10 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-01-13 13:23:10 (GMT)
commit8a90d26eafca6f78203e2af6e227e6404041b851 (patch)
tree259e8680d9866f7c345bee0b5c7dc89380f9b942
parent99b53ecd555fc85d8da85b6ca26bd8504e655d88 (diff)
parentbe409f301ed5dff8685300d8f28e0e06711ee22d (diff)
downloadtcl-8a90d26eafca6f78203e2af6e227e6404041b851.zip
tcl-8a90d26eafca6f78203e2af6e227e6404041b851.tar.gz
tcl-8a90d26eafca6f78203e2af6e227e6404041b851.tar.bz2
Merge 8.6
-rw-r--r--generic/tclCompile.h18
-rw-r--r--generic/tclExecute.c4
-rw-r--r--generic/tclProc.c2
3 files changed, 13 insertions, 11 deletions
diff --git a/generic/tclCompile.h b/generic/tclCompile.h
index 96a3541..30b364d 100644
--- a/generic/tclCompile.h
+++ b/generic/tclCompile.h
@@ -1495,22 +1495,22 @@ MODULE_SCOPE int TclPushProcCallFrame(void *clientData,
# define TclGetInt1AtPtr(p) ((int) *((signed char *) p))
#else
# define TclGetInt1AtPtr(p) \
- (((int) *((char *) p)) | ((*(p) & 0200) ? (-256) : 0))
+ ((int) ((*((char *) p)) | ((*(p) & 0200) ? (-256) : 0)))
#endif
#define TclGetInt4AtPtr(p) \
- (((int) (TclGetUInt1AtPtr(p) << 24)) | \
- (*((p)+1) << 16) | \
- (*((p)+2) << 8) | \
- (*((p)+3)))
+ ((int) ((TclGetUInt1AtPtr(p) << 24) | \
+ (*((p)+1) << 16) | \
+ (*((p)+2) << 8) | \
+ (*((p)+3))))
#define TclGetUInt1AtPtr(p) \
((unsigned int) *(p))
#define TclGetUInt4AtPtr(p) \
- ((unsigned int) (*(p) << 24) | \
- (*((p)+1) << 16) | \
- (*((p)+2) << 8) | \
- (*((p)+3)))
+ ((unsigned int) ((*(p) << 24) | \
+ (*((p)+1) << 16) | \
+ (*((p)+2) << 8) | \
+ (*((p)+3))))
/*
* Macros used to compute the minimum and maximum of two integers. The ANSI C
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index fdcddab..d03f1cb 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -5538,7 +5538,9 @@ TEBCresume(
p = ustring1;
end = ustring1 + length;
for (; ustring1 < end; ustring1++) {
- if ((*ustring1 == *ustring2) && (length2==1 ||
+ if ((*ustring1 == *ustring2) &&
+ /* Fix bug [69218ab7b]: restrict max compare length. */
+ (end-ustring1 >= length2) && (length2==1 ||
memcmp(ustring1, ustring2, sizeof(Tcl_UniChar) * length2)
== 0)) {
if (p != ustring1) {
diff --git a/generic/tclProc.c b/generic/tclProc.c
index 306f04c..afe846e 100644
--- a/generic/tclProc.c
+++ b/generic/tclProc.c
@@ -1438,7 +1438,6 @@ InitArgsAndLocals(
numArgs = procPtr->numArgs;
argCt = framePtr->objc - skip; /* Set it to the number of args to the
* procedure. */
- argObjs = framePtr->objv + skip;
if (numArgs == 0) {
if (argCt) {
goto incorrectArgs;
@@ -1446,6 +1445,7 @@ InitArgsAndLocals(
goto correctArgs;
}
}
+ argObjs = framePtr->objv + skip;
imax = ((argCt < numArgs-1) ? argCt : numArgs-1);
for (i = 0; i < imax; i++, varPtr++, defPtr ? defPtr++ : defPtr) {
/*