Stop segfault in mg.c:636
Richard Soderberg [Thu, 24 May 2001 05:51:52 +0000 (22:51 -0700)]
Message-ID: <NAEKLNAAHLMBPMPNBMLEGEPGDEAA.rs@crystalflame.net>

p4raw-id: //depot/perl@10194

mg.c

diff --git a/mg.c b/mg.c
index b68a52e..0c865bc 100644 (file)
--- a/mg.c
+++ b/mg.c
@@ -633,7 +633,7 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg)
                        PL_tainted = FALSE;
                    }
                    sv_setpvn(sv, s, i);
-                   if (DO_UTF8(PL_reg_sv) && is_utf8_string((U8*)s, i))
+                   if (PL_reg_sv && DO_UTF8(PL_reg_sv) && is_utf8_string((U8*)s, i))
                        SvUTF8_on(sv);
                    else
                        SvUTF8_off(sv);