Struct hyperpom::corpus::Corpus

source ·
pub struct Corpus { /* private fields */ }
Expand description

The corpus containing testcases shared between all fuzzing workers.

Role of the Corpus in the Fuzzer.

Our mutation-based fuzzer needs an initial set of testcases to start running. These testcases are stored in the corpus and can be loaded from a directory using Corpus::load_from_dir.

The fuzzer currently does not implement corpus minimization, a process that removes as many testcases as possible without reducing coverage. While implementing such a system would distill the current corpus to its essence, we would effectively lose out on information that might have been useful for later iterations (e.g. a testcase that sets up an internal state that would trigger a bug after being mutated for a few times). Instead, this fuzzer keeps all testcases, but favors the least used ones when picking the next testcase using Corpus::get_testcase.

Implementations

Creates a new shared corpus.

Loads all testcases stored in the path directory.

Adds a testcase to the shared corpus.

Gets one testcase from the shared corpus (the least used are more likely to be selected next).

Returns the numbers of testcases in the corpus.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.