summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-10-31 10:15:12 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-10-31 10:15:12 +0000
commit3792316810e8efe46eb83b553a1fffc0e1a35b80 (patch)
tree8d0857ae57ace287602478df1ab616595ce85124
parent8a6e5c043e3987ad386f9f3b61130c021c5c1b95 (diff)
downloadperl-3792316810e8efe46eb83b553a1fffc0e1a35b80.tar.gz
Fix (or hide?) a case of memory corruption with \K in substitutions
p4raw-id: //depot/perl@32206
-rw-r--r--regcomp.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/regcomp.c b/regcomp.c
index 3ad5d8c138..7c8c3911db 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -6898,6 +6898,11 @@ tryagain:
RExC_seen_zerolen++;
ret = reg_node(pRExC_state, KEEPS);
*flagp |= SIMPLE;
+ /* XXX:dmq : disabling in-place substitution seems to
+ * be necessary here to avoid cases of memory corruption, as
+ * with: C<$_="x" x 80; s/x\K/y/> -- rgs
+ */
+ RExC_seen |= REG_SEEN_LOOKBEHIND;
goto finish_meta_pat;
case 'Z':
ret = reg_node(pRExC_state, SEOL);