Skip to content

Commit

Permalink
fuzz: tweak limits
Browse files Browse the repository at this point in the history
This new fuzzer program caught a timeout. It looks mostly uninteresting.
It's basically the result of a huge regex running on a decently sized
haystack that is forced to use the PikeVM. The PikeVM is slow. We know
that.

Ref https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=60402
  • Loading branch information
BurntSushi committed Jul 6, 2023
1 parent 54690c2 commit c51486d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fuzz/fuzz_targets/fuzz_regex_match.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ re.is_match({haystack:?});
fuzz_target!(|case: FuzzCase| -> Corpus {
let _ = env_logger::try_init();

if case.haystack.len() > (16 * (1 << 10)) {
return Corpus::Reject;
}
let Ok(re) = regex::RegexBuilder::new(case.pattern)
.case_insensitive(case.case_insensitive)
.multi_line(case.multi_line)
Expand All @@ -62,7 +65,7 @@ fuzz_target!(|case: FuzzCase| -> Corpus {
.ignore_whitespace(case.ignore_whitespace)
.unicode(case.unicode)
.octal(case.octal)
.size_limit(1<<20)
.size_limit(1<<18)
.build() else { return Corpus::Reject };
re.is_match(case.haystack);
Corpus::Keep
Expand Down

0 comments on commit c51486d

Please sign in to comment.