summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069>2019-06-14 15:44:57 +0000
committerph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069>2019-06-14 15:44:57 +0000
commitfcbbd8d29b4558179e7b304e4bd75b714039433f (patch)
treea3b2549b68d61f0b8cbfd8d96e5cac684f24ddc9
parent993928201df0c42258f32da6c882b791b1fab441 (diff)
downloadpcre2-fcbbd8d29b4558179e7b304e4bd75b714039433f.tar.gz
Another fix to the recent (*ACCEPT) patch. Fixes clusterfuzz 15242.
git-svn-id: svn://vcs.exim.org/pcre2/code/trunk@1105 6239d852-aaf2-0410-a92c-79f79f948069
-rw-r--r--src/pcre2_compile.c18
-rw-r--r--testdata/testinput22
-rw-r--r--testdata/testoutput23
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