summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2004-10-02 21:49:15 +0000
committerNicholas Clark <nick@ccl4.org>2004-10-02 21:49:15 +0000
commit95899a2a29f7dc4950eff7768b479a7492599135 (patch)
tree97a4d51a6917e1f374b37f1b33bf871df4c86b32 /sv.c
parent53cd54806aabd2c7159c2bd2a9152721d6b02e08 (diff)
downloadperl-95899a2a29f7dc4950eff7768b479a7492599135.tar.gz
Perl_sv_recode_to_utf8 shouldn't be returning SvPVX(sv) without
any check on whether it's valid. p4raw-id: //depot/perl@23344
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sv.c b/sv.c
index 3a443a247f..5f91731d7f 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;
}
/*