summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorLarry Wall <larry@wall.org>1998-08-07 07:42:43 -0700
committerGurusamy Sarathy <gsar@cpan.org>1998-08-08 22:45:06 +0000
commita5a20234c16adf3662345bdfd872d14c28021bc0 (patch)
treeb3d1f0aa851ef56a868432b0f797b6502d34d4f1 /pp.c
parentd1c2b58ac830663c9c79b4948c8989557cac76b8 (diff)
downloadperl-a5a20234c16adf3662345bdfd872d14c28021bc0.tar.gz
fix double free on -Mutf8 -e '$b=uc("")'
Message-Id: <199808072142.OAA14920@wall.org> Subject: [PATCH 5.005_50]: uc("") and lc("") under utf8 fails p4raw-id: //depot/perl@1769
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/pp.c b/pp.c
index 3accab2d8c..a6f26f5c1e 100644
--- a/pp.c
+++ b/pp.c
@@ -2281,8 +2281,11 @@ PP(pp_uc)
U8 *send;
s = SvPV(sv,len);
- if (!len)
+ if (!len) {
+ sv_setpvn(TARG, "", 0);
+ SETs(TARG);
RETURN;
+ }
(void)SvUPGRADE(TARG, SVt_PV);
SvGROW(TARG, (len * 2) + 1);
@@ -2348,8 +2351,11 @@ PP(pp_lc)
U8 *send;
s = SvPV(sv,len);
- if (!len)
+ if (!len) {
+ sv_setpvn(TARG, "", 0);
+ SETs(TARG);
RETURN;
+ }
(void)SvUPGRADE(TARG, SVt_PV);
SvGROW(TARG, (len * 2) + 1);