Function afl::handle_read [] [src]

pub fn handle_read<F>(closure: F) where
    F: FnOnce(Stdin) + UnwindSafe

Utility that passes Stdin to closure for use with functions that expect a structure that implements Read. All panics that occur within closure will be treated as aborts. This is done so that AFL considers a panic to be a crash.

Examples

extern crate afl;

fn main() {
    afl::handle_bytes(|bytes| {
        Image::parse(&bytes)
    })
}