This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
SvPVutf8_nolen crashes [PATCH]
authorGisle Aas <gisle@aas.no>
Thu, 13 Oct 2005 06:00:49 +0000 (23:00 -0700)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Thu, 13 Oct 2005 12:38:21 +0000 (12:38 +0000)
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);
 }
 
 /*