diff --git a/fuzzers/libfuzzer_libpng/src/mod.rs b/fuzzers/libfuzzer_libpng/src/mod.rs index 91139ad60d..f793c6d4dd 100644 --- a/fuzzers/libfuzzer_libpng/src/mod.rs +++ b/fuzzers/libfuzzer_libpng/src/mod.rs @@ -84,10 +84,16 @@ fn fuzz(corpus_dirs: Vec, objective_dir: PathBuf, broker_port: u16) -> // If not restarting, create a State from scratch let mut state = state.unwrap_or_else(|| { State::new( + // RNG StdRand::new(current_nanos()), + // Corpus that will be evolved, we keep it in memory for performance InMemoryCorpus::new(), + // Feedbacks to rate the interestingness of an input tuple_list!(MaxMapFeedback::new_with_observer("edges", &edges_observer)), + // Corpus in which we store solutions (crashes in this example), + // on disk so the user can get them after stopping the fuzzer OnDiskCorpus::new(objective_dir), + // Feedbacks to recognize an input as solution tuple_list!(CrashFeedback::new()), ) }); @@ -131,7 +137,7 @@ fn fuzz(corpus_dirs: Vec, objective_dir: PathBuf, broker_port: u16) -> // In case the corpus is empty (on first run), reset if state.corpus().count() < 1 { - state + state .load_initial_inputs(&mut executor, &mut restarting_mgr, &corpus_dirs) .expect(&format!( "Failed to load initial corpus at {:?}",