From 7390ce13f6e1411d065ef4162c6f04da5030f4cb Mon Sep 17 00:00:00 2001 From: "Philip.Hazel" Date: Fri, 25 Nov 2016 10:37:23 +0000 Subject: [PATCH] Quantifiers following (*VERB)s were not being diagnosed. --- ChangeLog | 2 ++ src/pcre2_compile.c | 1 + testdata/testinput2 | 2 ++ testdata/testoutput2 | 3 +++ 4 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index 8dd69cf..c05fccb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -95,6 +95,8 @@ copied). was set, unpredictable behaviour could occur. The underlying bug was incorrect code and insufficient checking while searching for the end of the called subroutine in the parsed pattern. + + (m) Quantifiers following (*VERB)s were not being diagnosed as errors. 4. Back references are now permitted in lookbehind assertions when there are no duplicated group numbers (that is, (?| has not been used), and, if the diff --git a/src/pcre2_compile.c b/src/pcre2_compile.c index 2703791..345de43 100644 --- a/src/pcre2_compile.c +++ b/src/pcre2_compile.c @@ -2362,6 +2362,7 @@ while (ptr < ptrend) case CHAR_RIGHT_PARENTHESIS: inverbname = FALSE; + okquantifier = FALSE; /* Was probably set by literals */ /* This is the length in characters */ verbnamelength = (PCRE2_SIZE)(parsed_pattern - verblengthptr - 1); /* But the limit on the length is in code units */ diff --git a/testdata/testinput2 b/testdata/testinput2 index b2c66a1..ab20dcc 100644 --- a/testdata/testinput2 +++ b/testdata/testinput2 @@ -4918,4 +4918,6 @@ a)"xI /(?<=(?1))((?s))/anchored +/(*:ab)*/ + # End of testinput2 diff --git a/testdata/testoutput2 b/testdata/testoutput2 index d980c76..5a2d7c8 100644 --- a/testdata/testoutput2 +++ b/testdata/testoutput2 @@ -15369,6 +15369,9 @@ Failed: error 128 at offset 2: assertion expected after (?( or (?(?C) /(?<=(?1))((?s))/anchored +/(*:ab)*/ +Failed: error 109 at offset 6: quantifier does not follow a repeatable item + # End of testinput2 Error -63: PCRE2_ERROR_BADDATA (unknown error number) Error -62: bad serialized data