Skip to content

Commit c51486d

Browse files
committed
fuzz: tweak limits
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
1 parent 54690c2 commit c51486d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

fuzz/fuzz_targets/fuzz_regex_match.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ re.is_match({haystack:?});
5454
fuzz_target!(|case: FuzzCase| -> Corpus {
5555
let _ = env_logger::try_init();
5656

57+
if case.haystack.len() > (16 * (1 << 10)) {
58+
return Corpus::Reject;
59+
}
5760
let Ok(re) = regex::RegexBuilder::new(case.pattern)
5861
.case_insensitive(case.case_insensitive)
5962
.multi_line(case.multi_line)
@@ -62,7 +65,7 @@ fuzz_target!(|case: FuzzCase| -> Corpus {
6265
.ignore_whitespace(case.ignore_whitespace)
6366
.unicode(case.unicode)
6467
.octal(case.octal)
65-
.size_limit(1<<20)
68+
.size_limit(1<<18)
6669
.build() else { return Corpus::Reject };
6770
re.is_match(case.haystack);
6871
Corpus::Keep

0 commit comments

Comments
 (0)