Discard partial match when endanchored is set in the fuzzer, as it just gives
an immediate bad options return.
This commit is contained in:
parent
3f96e07e6b
commit
62e202f757
|
@ -42,7 +42,6 @@ bugs were never in fully released code, but are noted here for the record.
|
||||||
(g) Similarly refactor the way the variable length ovector is addressed for
|
(g) Similarly refactor the way the variable length ovector is addressed for
|
||||||
similar reasons. Fixes oss-fuzz issue 1465.
|
similar reasons. Fixes oss-fuzz issue 1465.
|
||||||
|
|
||||||
|
|
||||||
2. Now that pcre2_match() no longer uses recursive function calls (see above),
|
2. Now that pcre2_match() no longer uses recursive function calls (see above),
|
||||||
the "match limit recursion" value seems misnamed. It still exists, and limits
|
the "match limit recursion" value seems misnamed. It still exists, and limits
|
||||||
the depth of tree that is searched. To avoid future confusion, it has been
|
the depth of tree that is searched. To avoid future confusion, it has been
|
||||||
|
|
|
@ -94,6 +94,12 @@ compile_options =
|
||||||
match_options =
|
match_options =
|
||||||
((((uint32_t)r1 << 16) | ((uint32_t)r2 & 0xffff)) & ALLOWED_MATCH_OPTIONS);
|
((((uint32_t)r1 << 16) | ((uint32_t)r2 & 0xffff)) & ALLOWED_MATCH_OPTIONS);
|
||||||
|
|
||||||
|
/* Discard partial matching if PCRE2_ENDANCHORED is set, because they are not
|
||||||
|
allowed together and just give an immediate error return. */
|
||||||
|
|
||||||
|
if (((compile_options|match_options) & PCRE2_ENDANCHORED) != 0)
|
||||||
|
match_options &= ~(PCRE2_PARTIAL_HARD|PCRE2_PARTIAL_SOFT);
|
||||||
|
|
||||||
/* Do the compile with and without the options, and after a successful compile,
|
/* Do the compile with and without the options, and after a successful compile,
|
||||||
likewise do the match with and without the options. */
|
likewise do the match with and without the options. */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue