summaryrefslogtreecommitdiff
path: root/src/pcre2_fuzzsupport.c
diff options
context:
space:
mode:
authorph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069>2017-05-22 18:06:55 +0000
committerph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069>2017-05-22 18:06:55 +0000
commit24360bb0154064ded1f49f0dcf15d870042e682b (patch)
tree075b56333280b8814dc64fd132e4f2abcd013895 /src/pcre2_fuzzsupport.c
parent7059b2e989273cd5ebb951f419e2391048fe55df (diff)
downloadpcre2-24360bb0154064ded1f49f0dcf15d870042e682b.tar.gz
Screw down the depth limit for DFA matching in the fuzzer function. Fixes
OSS-fuzz 1761 (I hope). git-svn-id: svn://vcs.exim.org/pcre2/code/trunk@797 6239d852-aaf2-0410-a92c-79f79f948069
Diffstat (limited to 'src/pcre2_fuzzsupport.c')
-rw-r--r--src/pcre2_fuzzsupport.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/pcre2_fuzzsupport.c b/src/pcre2_fuzzsupport.c
index 7e13b5e..03d5ef9 100644
--- a/src/pcre2_fuzzsupport.c
+++ b/src/pcre2_fuzzsupport.c
@@ -172,11 +172,12 @@ for (i = 0; i < 2; i++)
return 0;
}
(void)pcre2_set_match_limit(match_context, 100);
- (void)pcre2_set_depth_limit(match_context, 100);
(void)pcre2_set_callout(match_context, callout_function, &callout_count);
}
- /* Match twice, with and without options */
+ /* Match twice, with and without options, with a depth limit of 100. */
+
+ (void)pcre2_set_depth_limit(match_context, 100);
for (j = 0; j < 2; j++)
{
@@ -210,9 +211,11 @@ for (i = 0; i < 2; i++)
match_options = 0; /* For second time */
}
- /* Match with DFA twice, with and without options */
+ /* Match with DFA twice, with and without options, depth limit of 10. */
+
+ (void)pcre2_set_depth_limit(match_context, 10);
+ match_options = save_match_options & ~PCRE2_NO_JIT; /* Not valid for DFA */
- match_options = save_match_options & ~PCRE2_NO_JIT;
for (j = 0; j < 2; j++)
{
#ifdef STANDALONE