Skip to content

Commit

Permalink
Limit the size of automaton keys in the peepmatic_fst_diff fuzz tar…
Browse files Browse the repository at this point in the history
…get (#1724)

This should avoid timeouts caused by large keys.

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=22251
  • Loading branch information
fitzgen committed May 19, 2020
1 parent a753775 commit 28d6df0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cranelift/peepmatic/crates/fuzzing/src/automata.rs
Expand Up @@ -109,7 +109,11 @@ pub fn simple_automata(input_output_pairs: Vec<Vec<(u8, Vec<u8>)>>) {
pub fn fst_differential(map: HashMap<Vec<u8>, u64>) {
let _ = env_logger::try_init();

let mut inputs: Vec<_> = map.keys().filter(|i| !i.is_empty()).cloned().collect();
let mut inputs: Vec<_> = map
.keys()
.filter(|k| !k.is_empty() && k.len() < 256)
.cloned()
.collect();
inputs.sort();
inputs.dedup();
if inputs.is_empty() {
Expand Down

0 comments on commit 28d6df0

Please sign in to comment.