From: Larry Wall Date: Fri, 7 Aug 1998 14:42:43 +0000 (-0700) Subject: fix double free on -Mutf8 -e '$b=uc("")' X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a5a20234c16adf3662345bdfd872d14c28021bc0;p=p5sagit%2Fp5-mst-13.2.git 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 --- diff --git a/pp.c b/pp.c index 3accab2..a6f26f5 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);