Skip to content

Commit 28d6df0

Browse files
authored
Limit the size of automaton keys in the peepmatic_fst_diff fuzz target (bytecodealliance#1724)
This should avoid timeouts caused by large keys. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=22251
1 parent a753775 commit 28d6df0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cranelift/peepmatic/crates/fuzzing/src/automata.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,11 @@ pub fn simple_automata(input_output_pairs: Vec<Vec<(u8, Vec<u8>)>>) {
109109
pub fn fst_differential(map: HashMap<Vec<u8>, u64>) {
110110
let _ = env_logger::try_init();
111111

112-
let mut inputs: Vec<_> = map.keys().filter(|i| !i.is_empty()).cloned().collect();
112+
let mut inputs: Vec<_> = map
113+
.keys()
114+
.filter(|k| !k.is_empty() && k.len() < 256)
115+
.cloned()
116+
.collect();
113117
inputs.sort();
114118
inputs.dedup();
115119
if inputs.is_empty() {

0 commit comments

Comments
 (0)