summaryrefslogtreecommitdiffstats
path: root/generic/tclCmdMZ.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2012-01-19 20:46:04 (GMT)
committerdgp <dgp@users.sourceforge.net>2012-01-19 20:46:04 (GMT)
commit868168e18953894ec72ea898ff4d2f518283184e (patch)
tree403c372c2579d691321cae91bd0a08637333017c /generic/tclCmdMZ.c
parentbbed95eccee9f7f5940bf4465a16ec6e6efbb84a (diff)
downloadtcl-868168e18953894ec72ea898ff4d2f518283184e.zip
tcl-868168e18953894ec72ea898ff4d2f518283184e.tar.gz
tcl-868168e18953894ec72ea898ff4d2f518283184e.tar.bz2
3475667 Prevent buffer read overflow. Thanks to "sebres" for the report and fix.
Diffstat (limited to 'generic/tclCmdMZ.c')
-rw-r--r--generic/tclCmdMZ.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c
index ccf3bc6..27e4055 100644
--- a/generic/tclCmdMZ.c
+++ b/generic/tclCmdMZ.c
@@ -378,7 +378,7 @@ Tcl_RegexpObjCmd(dummy, interp, objc, objv)
while (1) {
match = Tcl_RegExpExecObj(interp, regExpr, objPtr,
offset /* offset */, numMatchesSaved, eflags
- | ((offset > 0 &&
+ | ((offset > 0 && offset < stringLength &&
(Tcl_GetUniChar(objPtr,offset-1) != (Tcl_UniChar)'\n'))
? TCL_REG_NOTBOL : 0));