diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2001-04-11 02:54:39 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-04-11 02:54:39 +0000 |
commit | b8ef571c47de93e867861f93a04f9c8d328bd473 (patch) | |
tree | ecfc35105466ab7cddf08e107542a6db19f06fc9 /regexec.c | |
parent | b4324e9b79052046920e4a664bf29fd2d95cc19e (diff) | |
download | perl-b8ef571c47de93e867861f93a04f9c8d328bd473.tar.gz |
Integrate changes #9675,9676 from maintperl into mainline.
fix for bug 20010410.006, undo change#7115
port the OpenBSD glob() security patch
p4raw-link: @9676 on //depot/maint-5.6/perl: 3f3c3e312f619efa81ad88565a24e92f15dff662
p4raw-link: @9675 on //depot/maint-5.6/perl: c84593816ace2807d5ff27bb0745a28ec29187b1
p4raw-link: @7115 on //depot/perl: 5675c1a6395a0842c857fc8de159747577df6c4b
p4raw-id: //depot/perl@9677
p4raw-integrated: from //depot/maint-5.6/perl@9672 'copy in'
ext/File/Glob/bsd_glob.h (@9264..) ext/File/Glob/bsd_glob.c
(@9512..) ext/File/Glob/Glob.xs (@9545..) 'merge in' t/op/pat.t
(@9138..) regexec.c (@9288..) ext/File/Glob/Glob.pm (@9512..)
Diffstat (limited to 'regexec.c')
-rw-r--r-- | regexec.c | 20 |
1 files changed, 9 insertions, 11 deletions
@@ -391,19 +391,18 @@ Perl_re_intuit_start(pTHX_ regexp *prog, SV *sv, char *strpos, || ( (prog->reganch & ROPT_ANCH_BOL) && !PL_multiline ) ); /* Check after \n? */ - if (!ml_anch) { - if ( !(prog->reganch & ROPT_ANCH_GPOS) /* Checked by the caller */ - /* SvCUR is not set on references: SvRV and SvPVX overlap */ - && sv && !SvROK(sv) - && (strpos != strbeg)) { - DEBUG_r(PerlIO_printf(Perl_debug_log, "Not at start...\n")); - goto fail; - } - if (prog->check_offset_min == prog->check_offset_max && - !(prog->reganch & ROPT_SANY_SEEN)) { + if ((prog->check_offset_min == prog->check_offset_max) && !ml_anch) { /* Substring at constant offset from beg-of-str... */ I32 slen; + if ( !(prog->reganch & ROPT_ANCH_GPOS) /* Checked by the caller */ + /* SvCUR is not set on references: SvRV and SvPVX overlap */ + && sv && !SvROK(sv) + && (strpos != strbeg)) { + DEBUG_r(PerlIO_printf(Perl_debug_log, "Not at start...\n")); + goto fail; + } + PL_regeol = strend; /* Used in HOP() */ s = HOP3c(strpos, prog->check_offset_min, strend); if (SvTAIL(check)) { slen = SvCUR(check); /* >= 1 */ @@ -428,7 +427,6 @@ Perl_re_intuit_start(pTHX_ regexp *prog, SV *sv, char *strpos, && memNE(SvPVX(check), s, slen))) goto report_neq; goto success_at_start; - } } /* Match is anchored, but substr is not anchored wrt beg-of-str. */ s = strpos; |