summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
Diffstat (limited to 'generic')
-rw-r--r--generic/tclCmdMZ.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c
index 60a9414..ab673d5 100644
--- a/generic/tclCmdMZ.c
+++ b/generic/tclCmdMZ.c
@@ -264,7 +264,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 {