(
&self,
rng: &mut R,
dict: DictionaryRef,
input: &mut Vec<u8>,
key: StreamKey,
corpus: &CorpusStore<MultiStream>,
offset: usize,
)
| 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 | } |
no test coverage detected