diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2005-01-22 02:20:12 +0200 |
---|---|---|
committer | Dave Mitchell <davem@fdisolutions.com> | 2005-01-22 00:17:40 +0000 |
commit | 89ebb4a3f2a55825eeed13aaf58db5c73d2140ef (patch) | |
tree | a66444144493fa61d6befce0c9bf1358973f9872 /regcomp.c | |
parent | 80a13697042a4d823de61ba24b77aa9d893765d6 (diff) | |
download | perl-89ebb4a3f2a55825eeed13aaf58db5c73d2140ef.tar.gz |
Re: uc($long_utf8_string) exhausts memory
Message-Id: <41F1801C.3080201@iki.fi>
Make buffer size estimates for utf8 case conversion less maximally
pessimistic
p4raw-id: //depot/perl@23857
Diffstat (limited to 'regcomp.c')
-rw-r--r-- | regcomp.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -3088,7 +3088,7 @@ tryagain: char *oldp, *s; STRLEN numlen; STRLEN foldlen; - U8 tmpbuf[UTF8_MAXLEN_FOLD+1], *foldbuf; + U8 tmpbuf[UTF8_MAXBYTES_CASE+1], *foldbuf; parse_start = RExC_parse - 1; @@ -4199,7 +4199,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state) else if (prevnatvalue == natvalue) { Perl_sv_catpvf(aTHX_ listsv, "%04"UVxf"\n", natvalue); if (FOLD) { - U8 foldbuf[UTF8_MAXLEN_FOLD+1]; + U8 foldbuf[UTF8_MAXBYTES_CASE+1]; STRLEN foldlen; UV f = to_uni_fold(natvalue, foldbuf, &foldlen); @@ -4869,7 +4869,7 @@ Perl_regprop(pTHX_ SV *sv, regnode *o) if (lv) { if (sw) { - U8 s[UTF8_MAXLEN+1]; + U8 s[UTF8_MAXBYTES_CASE+1]; for (i = 0; i <= 256; i++) { /* just the first 256 */ U8 *e = uvchr_to_utf8(s, i); |