summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2000-12-03 20:57:19 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2000-12-03 20:57:19 +0000
commitad391ad9bbfeaf73d3944b50240313a5677bcc60 (patch)
tree270b2e4acd993a5e6c9721113cd4130e6ca64f4e /pp.c
parent801ca9cd5af7c86da741a601b4721bff3f94f9cd (diff)
downloadperl-ad391ad9bbfeaf73d3944b50240313a5677bcc60.tar.gz
Make uv_to_utf8() to zero-terminate its output buffer,
always use (at least) UTF8_MAXLEN + 1 U8s deep buffer. p4raw-id: //depot/perl@7967
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/pp.c b/pp.c
index 17beb6c8a1..10e6c6aa99 100644
--- a/pp.c
+++ b/pp.c
@@ -2321,7 +2321,7 @@ PP(pp_ucfirst)
if (DO_UTF8(sv) && (s = (U8*)SvPV(sv, slen)) && slen && (*s & 0xc0) == 0xc0) {
STRLEN ulen;
- U8 tmpbuf[UTF8_MAXLEN];
+ U8 tmpbuf[UTF8_MAXLEN+1];
U8 *tend;
UV uv = utf8_to_uv(s, slen, &ulen, 0);
@@ -2380,7 +2380,7 @@ PP(pp_lcfirst)
if (DO_UTF8(sv) && (s = (U8*)SvPV(sv, slen)) && slen && (*s & 0xc0) == 0xc0) {
STRLEN ulen;
- U8 tmpbuf[UTF8_MAXLEN];
+ U8 tmpbuf[UTF8_MAXLEN+1];
U8 *tend;
UV uv = utf8_to_uv(s, slen, &ulen, 0);
@@ -4727,7 +4727,7 @@ PP(pp_pack)
while (len-- > 0) {
fromstr = NEXTFROM;
auint = SvUV(fromstr);
- SvGROW(cat, SvCUR(cat) + UTF8_MAXLEN);
+ SvGROW(cat, SvCUR(cat) + UTF8_MAXLEN + 1);
SvCUR_set(cat, (char*)uv_to_utf8((U8*)SvEND(cat),auint)
- SvPVX(cat));
}