summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2018-01-22 12:45:14 -0700
committerKarl Williamson <khw@cpan.org>2018-01-22 12:49:20 -0700
commit81b3f640bb2856350fe6a5efe32056accab1d775 (patch)
tree3a5c0476c9b773c3ae192f5e48fed2a2358e4ee8 /regcomp.c
parent10417d4775a08e4e3438d6f298f69b6ada5e2fea (diff)
downloadperl-81b3f640bb2856350fe6a5efe32056accab1d775.tar.gz
Allow space for NUL is UTF-8 array decls
In grepping the source, I noticed that several arrays that are for holding UTF-8 characters did not allow space for a trailing NUL. This commit adds that.
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/regcomp.c b/regcomp.c
index 54f9fad0ff..d0952cb48f 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -13267,7 +13267,7 @@ S_regatom(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth)
char *p;
char *s;
#define MAX_NODE_STRING_SIZE 127
- char foldbuf[MAX_NODE_STRING_SIZE+UTF8_MAXBYTES_CASE];
+ char foldbuf[MAX_NODE_STRING_SIZE+UTF8_MAXBYTES_CASE+1];
char *s0;
U8 upper_parse = MAX_NODE_STRING_SIZE;
U8 node_type = compute_EXACTish(pRExC_state);
@@ -17013,7 +17013,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth,
{
/* Here <value> is indeed a multi-char fold. Get what it is */
- U8 foldbuf[UTF8_MAXBYTES_CASE];
+ U8 foldbuf[UTF8_MAXBYTES_CASE+1];
STRLEN foldlen;
UV folded = _to_uni_fold_flags(