From a5a20234c16adf3662345bdfd872d14c28021bc0 Mon Sep 17 00:00:00 2001 From: Larry Wall Date: Fri, 7 Aug 1998 07:42:43 -0700 Subject: 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 --- pp.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'pp.c') 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); -- cgit v1.2.1