image/fuzz-afl
2024-02-18 15:09:12 -08:00
..
.cargo Update afl to 0.10, fix run issue 2021-10-02 20:58:11 +02:00
fuzzers Switch to image-webp (#2148) 2024-02-18 15:09:12 -08:00
in Add current minimized webp corpus 2019-05-06 16:39:24 +02:00
reproducers Switch to image-webp (#2148) 2024-02-18 15:09:12 -08:00
.gitignore Add minimization script and previously crashing input 2019-02-13 00:29:41 +01:00
Cargo.toml Simplify cargo features (#1976) 2024-02-11 18:25:20 -08:00
minimize.sh Rename fuzzing samples for windows compatibility 2019-04-28 20:35:45 +02:00
README.md Update afl to 0.10, fix run issue 2021-10-02 20:58:11 +02:00

Fuzzing harnesses

This is intended for integration fuzzing and those decoders that do not yet live in their own crate. image-png for example has their own fuzzing targets.

Using the fuzzer

Install afl:

$ cargo install afl

Build fuzz target:

$ cargo afl build --bin fuzz_<format>

Run afl:

$ mkdir out/<format>
$ cargo afl fuzz -i ./in/<format> -o ./out/<format> ./target/debug/fuzz_<format>

To reproduce a crash:

$ cargo run --bin reproduce_<format>

Known issues

Since about Oct. 2021 the nightly Rust builds use an llvm version that no longer accepts one of the sanitizer passes. As a temporary workaround you must adjust the flags passed to afl:

$ RUSTFLAGS="-Znew-llvm-pass-manager=no" cargo +nightly afl run …