summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doop.c2
-rw-r--r--op.c2
-rw-r--r--perl.c2
-rw-r--r--pp.c6
-rw-r--r--regcomp.c2
-rw-r--r--regexec.c2
-rw-r--r--sv.c2
7 files changed, 9 insertions, 9 deletions
diff --git a/doop.c b/doop.c
index 34cc0e3361..0dbfe20c48 100644
--- a/doop.c
+++ b/doop.c
@@ -282,7 +282,7 @@ S_do_trans_CU_simple(pTHX_ SV *sv)
UV extra = none + 1;
UV final;
UV uv;
- U8 tmpbuf[10];
+ U8 tmpbuf[UTF8_MAXLEN];
I32 bits = 16;
s = (U8*)SvPV(sv, len);
diff --git a/op.c b/op.c
index 04a84b8e6a..5b8a223af0 100644
--- a/op.c
+++ b/op.c
@@ -2607,7 +2607,7 @@ Perl_pmtrans(pTHX_ OP *o, OP *expr, OP *repl)
I32 to_utf = o->op_private & OPpTRANS_TO_UTF;
if (complement) {
- U8 tmpbuf[10];
+ U8 tmpbuf[UTF8_MAXLEN];
U8** cp;
UV nextmin = 0;
New(1109, cp, tlen, U8*);
diff --git a/perl.c b/perl.c
index 46ffde5bff..8f53c3648e 100644
--- a/perl.c
+++ b/perl.c
@@ -220,7 +220,7 @@ perl_construct(pTHXx)
PL_patchlevel = NEWSV(0,4);
SvUPGRADE(PL_patchlevel, SVt_PVNV);
if (PERL_REVISION > 127 || PERL_VERSION > 127 || PERL_SUBVERSION > 127)
- SvGROW(PL_patchlevel,24);
+ SvGROW(PL_patchlevel, UTF8_MAXLEN*3+1);
s = (U8*)SvPVX(PL_patchlevel);
s = uv_to_utf8(s, (UV)PERL_REVISION);
s = uv_to_utf8(s, (UV)PERL_VERSION);
diff --git a/pp.c b/pp.c
index b6275ddd47..87d10f7fe3 100644
--- a/pp.c
+++ b/pp.c
@@ -2254,7 +2254,7 @@ PP(pp_ucfirst)
if (DO_UTF8(sv) && (s = (U8*)SvPV(sv, slen)) && slen && (*s & 0xc0) == 0xc0) {
I32 ulen;
- U8 tmpbuf[10];
+ U8 tmpbuf[UTF8_MAXLEN];
U8 *tend;
UV uv = utf8_to_uv(s, &ulen);
@@ -2313,7 +2313,7 @@ PP(pp_lcfirst)
if (DO_UTF8(sv) && (s = (U8*)SvPV(sv, slen)) && slen && (*s & 0xc0) == 0xc0) {
I32 ulen;
- U8 tmpbuf[10];
+ U8 tmpbuf[UTF8_MAXLEN];
U8 *tend;
UV uv = utf8_to_uv(s, &ulen);
@@ -4645,7 +4645,7 @@ PP(pp_pack)
while (len-- > 0) {
fromstr = NEXTFROM;
auint = SvUV(fromstr);
- SvGROW(cat, SvCUR(cat) + 10);
+ SvGROW(cat, SvCUR(cat) + UTF8_MAXLEN);
SvCUR_set(cat, (char*)uv_to_utf8((U8*)SvEND(cat),auint)
- SvPVX(cat));
}
diff --git a/regcomp.c b/regcomp.c
index a3106dc445..8046c76056 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -3646,7 +3646,7 @@ S_reguni(pTHX_ UV uv, char* s, I32* lenp)
{
dTHR;
if (SIZE_ONLY) {
- U8 tmpbuf[10];
+ U8 tmpbuf[UTF8_MAXLEN];
*lenp = uv_to_utf8(tmpbuf, uv) - tmpbuf;
}
else
diff --git a/regexec.c b/regexec.c
index bddf8201c2..c65624b216 100644
--- a/regexec.c
+++ b/regexec.c
@@ -3610,7 +3610,7 @@ S_reginclassutf8(pTHX_ regnode *f, U8 *p)
match = TRUE;
else if (flags & ANYOF_FOLD) {
I32 cf;
- U8 tmpbuf[10];
+ U8 tmpbuf[UTF8_MAXLEN];
if (flags & ANYOF_LOCALE) {
PL_reg_flags |= RF_tainted;
uv_to_utf8(tmpbuf, toLOWER_LC_utf8(p));
diff --git a/sv.c b/sv.c
index fb33f383b4..2f5ea0b7b7 100644
--- a/sv.c
+++ b/sv.c
@@ -5741,7 +5741,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV
bool is_utf = FALSE;
char esignbuf[4];
- U8 utf8buf[10];
+ U8 utf8buf[UTF8_MAXLEN];
STRLEN esignlen = 0;
char *eptr = Nullch;