MCPcopy Create free account
hub / github.com/MultiFuzz/MultiFuzz / havoc_v2

Method havoc_v2

hail-fuzz/src/havoc.rs:152–176  ·  view source on GitHub ↗
(&mut self, fuzzer: &mut Fuzzer)

Source from the content-addressed store, hash-verified

150
151 #[allow(unused)]
152 fn havoc_v2(&mut self, fuzzer: &mut Fuzzer) {
153 let Some(input_id) = fuzzer.input_id
154 else {
155 return;
156 };
157 let max_find_gap = fuzzer.corpus[input_id].metadata.max_find_gap;
158
159 let data = &mut fuzzer.state.input;
160 for &(key, _) in &self.streams {
161 // Decided whether this stream should be mutated.
162 if fuzzer.rng.gen_bool(0.5) {
163 continue;
164 }
165
166 let bytes = &mut data.streams.get_mut(&key).unwrap().bytes;
167 let local_dict = fuzzer.dict.entry(key).or_default();
168 local_dict.compute_weights();
169 let dict = DictionaryRef { local: local_dict, global: &fuzzer.global_dict };
170
171 let mutations = fuzzer.rng.gen_range(1..=self.log2_max_mutations);
172 for _ in 0..mutations {
173 self.mutator.havoc_bytes(&mut fuzzer.rng, dict, bytes, key, &fuzzer.corpus, 0);
174 }
175 }
176 }
177}
178
179/// Determine the maximum number of mutations to try. This number increases the longer it takes to

Callers

nothing calls this directly

Calls 3

get_mutMethod · 0.80
compute_weightsMethod · 0.80
havoc_bytesMethod · 0.80

Tested by

no test coverage detected