summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069>2019-02-13 16:48:30 +0000
committerph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069>2019-02-13 16:48:30 +0000
commitc93653c87aa0bf7a24038961afb1189005a256a6 (patch)
tree4b6347ec878eee31e3c44ca38ce1cc22d68478cd
parent4e01f37e73ba7afa29fbfbe45a5f923efb0a1c68 (diff)
downloadpcre2-c93653c87aa0bf7a24038961afb1189005a256a6.tar.gz
Fix overflow bug in new /u code. Fixes ClusterFuzz 13073.
git-svn-id: svn://vcs.exim.org/pcre2/code/trunk@1071 6239d852-aaf2-0410-a92c-79f79f948069
-rw-r--r--src/pcre2_compile.c1
-rw-r--r--testdata/testinput53
-rw-r--r--testdata/testoutput54
3 files changed, 8 insertions, 0 deletions
diff --git a/src/pcre2_compile.c b/src/pcre2_compile.c
index 1edcf1a..5a6f88c 100644
--- a/src/pcre2_compile.c
+++ b/src/pcre2_compile.c
@@ -1596,6 +1596,7 @@ else
{
uint32_t xc;
+ if (ptr >= ptrend) break;
if (*ptr == CHAR_LEFT_CURLY_BRACKET &&
(extra_options & PCRE2_EXTRA_ALT_BSUX) != 0)
{
diff --git a/testdata/testinput5 b/testdata/testinput5
index b48d27a..2c4e847 100644
--- a/testdata/testinput5
+++ b/testdata/testinput5
@@ -817,6 +817,9 @@
/^\u{0000000000010ffff}/utf,extra_alt_bsux
\x{10ffff}
+/\u/utf,alt_bsux
+ \\u
+
/^a+[a\x{200}]/B,utf
aa
diff --git a/testdata/testoutput5 b/testdata/testoutput5
index 2bcb39f..23438dd 100644
--- a/testdata/testoutput5
+++ b/testdata/testoutput5
@@ -1738,6 +1738,10 @@ Failed: error 173 at offset 6: disallowed Unicode code point (>= 0xd800 && <= 0x
\x{10ffff}
0: \x{10ffff}
+/\u/utf,alt_bsux
+ \\u
+ 0: u
+
/^a+[a\x{200}]/B,utf
------------------------------------------------------------------
Bra