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

Method havoc_bytes

hail-fuzz/src/havoc.rs:268–294  ·  view source on GitHub ↗
(
        &self,
        rng: &mut R,
        dict: DictionaryRef,
        input: &mut Vec<u8>,
        key: StreamKey,
        corpus: &CorpusStore<MultiStream>,
        offset: usize,
    )

Source from the content-addressed store, hash-verified

266 }
267
268 pub(crate) fn havoc_bytes<R>(
269 &self,
270 rng: &mut R,
271 dict: DictionaryRef,
272 input: &mut Vec<u8>,
273 key: StreamKey,
274 corpus: &CorpusStore<MultiStream>,
275 offset: usize,
276 ) -> Option<Mutation>
277 where
278 R: Rng,
279 {
280 if input.is_empty() {
281 random_bytes(rng, input);
282 return None;
283 }
284
285 let mutation = ALL_MUTATIONS[self.mutation_distr.sample(rng)];
286 mutations::apply_mutation(mutation, rng, dict, input, key, corpus, offset);
287
288 if input.is_empty() {
289 random_bytes(rng, input);
290 return None;
291 }
292
293 Some(mutation)
294 }
295}

Callers 2

havoc_v1Method · 0.80
havoc_v2Method · 0.80

Calls 3

random_bytesFunction · 0.85
apply_mutationFunction · 0.85
is_emptyMethod · 0.80

Tested by

no test coverage detected