From 2171b321cf1ec2d7c671d02dfea59860bccc06f2 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 12 Jan 2022 15:50:30 +0000 Subject: Fix [69218ab7b]: TEBCResume(): buffer over-read in INST_STR_MAP --- generic/tclExecute.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 7e014d4..aa5730a 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -5855,7 +5855,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) { -- cgit v0.12