From: Nicholas Clark Date: Sat, 2 Oct 2004 21:49:15 +0000 (+0000) Subject: Perl_sv_recode_to_utf8 shouldn't be returning SvPVX(sv) without X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=95899a2a29f7dc4950eff7768b479a7492599135;p=p5sagit%2Fp5-mst-13.2.git Perl_sv_recode_to_utf8 shouldn't be returning SvPVX(sv) without any check on whether it's valid. p4raw-id: //depot/perl@23344 --- diff --git a/sv.c b/sv.c index 3a443a2..5f91731 100644 --- a/sv.c +++ b/sv.c @@ -12283,8 +12283,9 @@ Perl_sv_recode_to_utf8(pTHX_ SV *sv, SV *encoding) FREETMPS; LEAVE; SvUTF8_on(sv); + return SvPVX(sv); } - return SvPVX(sv); + return SvPOKp(sv) ? SvPVX(sv) : NULL; } /*