This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
$& segfaults if you trick it
authorSimon Cozens <simon@netthink.co.uk>
Fri, 7 Jul 2000 11:26:09 +0000 (11:26 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Tue, 11 Jul 2000 13:26:47 +0000 (13:26 +0000)
Message-ID: <slrn8mbfif.ead.simon@justanother.perlhacker.org>

p4raw-id: //depot/cfgperl@6336

mg.c

diff --git a/mg.c b/mg.c
index b1049c5..aee2790 100644 (file)
--- a/mg.c
+++ b/mg.c
@@ -614,6 +614,9 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg)
            {
                i = t1 - s1;
                s = rx->subbeg + s1;
+                if (!rx->subbeg)
+                   break;
+
              getrx:
                if (i >= 0) {
                    bool was_tainted;