Assert that we don't access strings saved for $1 etc. out of bounds
Rafael Garcia-Suarez [Tue, 14 Nov 2006 11:35:04 +0000 (11:35 +0000)]
p4raw-id: //depot/perl@29271

mg.c

diff --git a/mg.c b/mg.c
index 425190b..f82aa0d 100644 (file)
--- a/mg.c
+++ b/mg.c
@@ -854,6 +854,7 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg)
                i = t1 - s1;
                s = rx->subbeg + s1;
                assert(rx->subbeg);
+               assert(rx->sublen >= s1);
 
              getrx:
                if (i >= 0) {