Solution Corpus

Unlike our working corpus, we want to keep any solutions we find, so we'll store them on disk. We can use an OnDiskCorpus to store solutions (crashes) that we discover. We'll add the use declaration:

#![allow(unused)]
fn main() {
use libafl::prelude::OnDiskCorpus;
}

We'll create our corpus at the path we specify in our program arguments, and panic with an appropriate error message if the operation fails.

#![allow(unused)]
fn main() {
let solutions = OnDiskCorpus::new(&args.solutions).unwrap_or_else(|e| {
    panic!(
        "Unable to create OnDiskCorpus at {}: {}",
        args.solutions.display(),
        e
    )
});
}