| Name | Last commit date | |
|---|---|---|
| .. | ||
| artifacts | 6 months ago | |
| corpus | 6 months ago | |
| fuzz_targets | 4 months ago | |
| src | 6 months ago | |
| .gitignore | 6 months ago | |
| Cargo.toml | 4 months ago | |
| README.md | 6 months ago | |
Fuzz Testing
This directory contains fuzz tests for gix-pack using cargo-fuzz.
Running Fuzz Tests
Prerequisites
- Nightly Rust toolchain:
rustup install nightly - cargo-fuzz:
cargo install cargo-fuzz
Targets
data_file: exercises.packparsing, checksum verification, entry lookup, and entry decoding.index_file: exercises.idxparsing, checksum verification, lookups, prefix lookups, and iteration.multi_index_file: exercises multi-pack-index parsing, checksum verification, lookups, prefix lookups, and iteration.
Running a specific target
cargo +nightly fuzz run data_file -- -max_total_time=60
cargo +nightly fuzz run index_file -- -max_total_time=60
cargo +nightly fuzz run multi_index_file -- -max_total_time=60
Running all targets
for target in data_file index_file multi_index_file; do
cargo +nightly fuzz run "$target" -- -max_total_time=60
done
Artifact Reproducers
The artifacts/<target> directories contain minimized reproducer inputs produced by libFuzzer or Google OSS-Fuzz.
The integration test module fuzzed reads every regular file in the populated artifact directories and runs it through the parser under test. This lets cargo test -p gix-pack fuzzed reproduce known fuzz failures without starting a fuzzing session.
When OSS-Fuzz reports a new failure, place the minimized testcase in the matching artifacts/<target> directory, then run cargo test -p gix-pack fuzzed. To confirm it against the original harness, run cargo fuzz run <target> artifacts/<target>/<reproducer> from this directory.