Setup fuzzing with `cargo afl`
masterFuzzing is supported via cargo afl. To begin, install the tool and then follow the specific build commands for reading or writing.
Install cargo-afl:
cargo install cargo-aflFuzzing Extraction (Reading):
- Create an output directory:
mkdir -vp fuzz-read-out - Build the fuzzer:
cargo afl build --manifest-path=fuzz/Cargo.toml --all-features -p fuzz_read - Run with a curated corpus:
cargo afl fuzz -i fuzz/read/in -o fuzz-read-out fuzz/target/debug/fuzz_read - Run with test data:
cargo afl fuzz -i tests/data -e zip -o fuzz-read-out fuzz/target/debug/fuzz_read
Fuzzing Creation (Writing):
- Create an output directory:
mkdir -vp fuzz-write-out - Build the fuzzer:
cargo afl build --manifest-path=fuzz/Cargo.toml --all-features -p fuzz_write - Run with corpus and dictionary:
cargo afl fuzz -x fuzz/write/fuzz.dict -i fuzz/write/in -o fuzz-write-out fuzz/target/debug/fuzz_write
# Example: Install cargo-afl
cargo install cargo-afl