Fix overflow bug in new /u code. Fixes ClusterFuzz 13073.

This commit is contained in:
Philip.Hazel 2019-02-13 16:48:30 +00:00
parent 8c8deae8eb
commit f2e1cea288
3 changed files with 8 additions and 0 deletions

View File

@ -1596,6 +1596,7 @@ else
{ {
uint32_t xc; uint32_t xc;
if (ptr >= ptrend) break;
if (*ptr == CHAR_LEFT_CURLY_BRACKET && if (*ptr == CHAR_LEFT_CURLY_BRACKET &&
(extra_options & PCRE2_EXTRA_ALT_BSUX) != 0) (extra_options & PCRE2_EXTRA_ALT_BSUX) != 0)
{ {

3
testdata/testinput5 vendored
View File

@ -817,6 +817,9 @@
/^\u{0000000000010ffff}/utf,extra_alt_bsux /^\u{0000000000010ffff}/utf,extra_alt_bsux
\x{10ffff} \x{10ffff}
/\u/utf,alt_bsux
\\u
/^a+[a\x{200}]/B,utf /^a+[a\x{200}]/B,utf
aa aa

View File

@ -1738,6 +1738,10 @@ Failed: error 173 at offset 6: disallowed Unicode code point (>= 0xd800 && <= 0x
\x{10ffff} \x{10ffff}
0: \x{10ffff} 0: \x{10ffff}
/\u/utf,alt_bsux
\\u
0: u
/^a+[a\x{200}]/B,utf /^a+[a\x{200}]/B,utf
------------------------------------------------------------------ ------------------------------------------------------------------
Bra Bra