From 300bf6e2d6dfce6f795d481f86c97df50a314585 Mon Sep 17 00:00:00 2001 From: "Philip.Hazel" Date: Fri, 14 Jun 2019 15:44:57 +0000 Subject: [PATCH] Another fix to the recent (*ACCEPT) patch. Fixes clusterfuzz 15242. --- src/pcre2_compile.c | 18 ++++++++++++++---- testdata/testinput2 | 2 ++ testdata/testoutput2 | 3 +++ 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/pcre2_compile.c b/src/pcre2_compile.c index c06327b..bf2403e 100644 --- a/src/pcre2_compile.c +++ b/src/pcre2_compile.c @@ -2599,10 +2599,20 @@ while (ptr < ptrend) errorcode = ERR28; goto FAILED; } - if (!inverbname && after_manual_callout-- <= 0) - parsed_pattern = manage_callouts(thisptr, &previous_callout, - auto_callout, parsed_pattern, cb); - PARSED_LITERAL(c, parsed_pattern); + if (inverbname) + { /* Don't use PARSED_LITERAL() because it */ +#if PCRE2_CODE_UNIT_WIDTH == 32 /* sets okquantifier. */ + if (c >= META_END) *parsed_pattern++ = META_BIGVALUE; +#endif + *parsed_pattern++ = c; + } + else + { + if (after_manual_callout-- <= 0) + parsed_pattern = manage_callouts(thisptr, &previous_callout, + auto_callout, parsed_pattern, cb); + PARSED_LITERAL(c, parsed_pattern); + } meta_quantifier = 0; } continue; /* Next character */ diff --git a/testdata/testinput2 b/testdata/testinput2 index 22d16ec..bfec80c 100644 --- a/testdata/testinput2 +++ b/testdata/testinput2 @@ -5605,4 +5605,6 @@ a)"xI /(*:\)?/ +/(*:\Q \E){5}/alt_verbnames + # End of testinput2 diff --git a/testdata/testoutput2 b/testdata/testoutput2 index 2fd3c62..74e10a5 100644 --- a/testdata/testoutput2 +++ b/testdata/testoutput2 @@ -16960,6 +16960,9 @@ MK: XX /(*:\)?/ Failed: error 109 at offset 5: quantifier does not follow a repeatable item +/(*:\Q \E){5}/alt_verbnames +Failed: error 109 at offset 11: quantifier does not follow a repeatable item + # End of testinput2 Error -70: PCRE2_ERROR_BADDATA (unknown error number) Error -62: bad serialized data