summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--generic/tclCmdMZ.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 458bb51..0af50d9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-01-19 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tclCmdMZ.c: [Bug 3475667] Prevent buffer read overflow.
+ Thanks to "sebres" for the report and fix.
+
2012-01-17 Donal K. Fellows <dkf@users.sf.net>
* doc/dict.n (dict with): [Bug 3474512]: Explain better what is going
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c
index e7c7152..e159f67 100644
--- a/generic/tclCmdMZ.c
+++ b/generic/tclCmdMZ.c
@@ -282,7 +282,7 @@ Tcl_RegexpObjCmd(
* start of the string unless the previous character is a newline.
*/
- if ((offset == 0) || ((offset > 0) &&
+ if ((offset == 0) || ((offset > 0) && (offset < stringLength) &&
(Tcl_GetUniChar(objPtr, offset-1) == (Tcl_UniChar) '\n'))) {
eflags = 0;
} else {