summaryrefslogtreecommitdiff
path: root/pcre/pcre_compile.c
diff options
context:
space:
mode:
authorVicențiu Ciorbaru <vicentiu@mariadb.org>2017-07-30 11:53:36 +0300
committerVicențiu Ciorbaru <vicentiu@mariadb.org>2017-07-30 11:53:36 +0300
commitdba454ef54bfc83cc1ade93c668f39ec0a5895d3 (patch)
tree1ea904c2a08d6258cd28e22138ea789d9eb8d037 /pcre/pcre_compile.c
parentdfd7749120e592299fddf2710bc336ee1000ae07 (diff)
downloadmariadb-git-dba454ef54bfc83cc1ade93c668f39ec0a5895d3.tar.gz
8.41
Diffstat (limited to 'pcre/pcre_compile.c')
-rw-r--r--pcre/pcre_compile.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/pcre/pcre_compile.c b/pcre/pcre_compile.c
index de92313e2f8..42f204cdfff 100644
--- a/pcre/pcre_compile.c
+++ b/pcre/pcre_compile.c
@@ -5739,6 +5739,21 @@ for (;; ptr++)
ptr = p - 1; /* Character before the next significant one. */
}
+ /* We also need to skip over (?# comments, which are not dependent on
+ extended mode. */
+
+ if (ptr[1] == CHAR_LEFT_PARENTHESIS && ptr[2] == CHAR_QUESTION_MARK &&
+ ptr[3] == CHAR_NUMBER_SIGN)
+ {
+ ptr += 4;
+ while (*ptr != CHAR_NULL && *ptr != CHAR_RIGHT_PARENTHESIS) ptr++;
+ if (*ptr == CHAR_NULL)
+ {
+ *errorcodeptr = ERR18;
+ goto FAILED;
+ }
+ }
+
/* If the next character is '+', we have a possessive quantifier. This
implies greediness, whatever the setting of the PCRE_UNGREEDY option.
If the next character is '?' this is a minimizing repeat, by default,
@@ -8210,7 +8225,6 @@ for (;; ptr++)
if (mclength == 1 || req_caseopt == 0)
{
- firstchar = mcbuffer[0] | req_caseopt;
firstchar = mcbuffer[0];
firstcharflags = req_caseopt;