rust-fuzz / honggfuzz-rs

Fuzz your Rust code with Google-developed Honggfuzz !
https://crates.io/crates/honggfuzz
Apache License 2.0
448 stars 40 forks source link

`fuzz!` macro doesn't support mutable bindings #66

Open cbiffle opened 2 years ago

cbiffle commented 2 years ago

Test case resembles:

        fuzz!(|mut data: &[u8]| {
            loop {
                match hubpack::deserialize::<Structy>(data) {
                    Err(_) => break,
                    Ok((_, rest)) => data = rest,
                }
            }
        });

Alas:

28 |         fuzz!(|mut data: &[u8]| {
   |                    ^^^^ no rules expected this token in macro call

I assume the fuzz! macro is currently parsing the closure header too narrowly.