honggfuzz-rs

Fuzz your Rust code with Honggfuzz !

asciicast

About Honggfuzz

Description (from upstream project)

How to use this crate

Install honggfuzz command to build with instrumentation and fuzz sh cargo install honggfuzz # will install honggfuzz and honggfuzz-build subcommands in cargo Add to your dependencies toml [dependencies] honggfuzz = "0.2" Add code snippet to fuzz ```rust

![no_main]

[macro_use] extern crate honggfuzz;

fuzztarget!(|data: &[u8]| { if data.len() != 10 {return} if data[0] != 'q' as u8 {return} if data[1] != 'w' as u8 {return} if data[2] != 'e' as u8 {return} if data[3] != 'r' as u8 {return} if data[4] != 't' as u8 {return} if data[5] != 'y' as u8 {return} if data[6] != 'u' as u8 {return} if data[7] != 'i' as u8 {return} if data[8] != 'o' as u8 {return} if data[9] != 'p' as u8 {return} panic!("BOOM") }); Build with instrumentation sh cargo honggfuzz-build # a wrapper on "cargo build" with fuzzing instrumentation enabled. produces binaries in "fuzzingtarget" directory ```

Fuzz sh mkdir in cargo honggfuzz -f in -P -- fuzzing_target/x86_64-unknown-linux-gnu/debug/fuzzme # a wrapper on honggfuzz executable with settings adapted to work with Rust code