SvPVutf8_nolen crashes [PATCH]
Gisle Aas [Thu, 13 Oct 2005 06:00:49 +0000 (23:00 -0700)]
Message-ID: <lrslv56072.fsf@caliper.activestate.com>

p4raw-id: //depot/perl@25751

sv.c

diff --git a/sv.c b/sv.c
index 9bb43e7..1b2a0c4 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -3428,7 +3428,7 @@ char *
 Perl_sv_2pvutf8(pTHX_ register SV *sv, STRLEN *lp)
 {
     sv_utf8_upgrade(sv);
-    return SvPV(sv,*lp);
+    return lp ? SvPV(sv,*lp) : SvPV_nolen(sv);
 }
 
 /*