trying to read empty buffer in sequoia_openpgp_ffi::parse::pgp_packet_parser_from_bytes
This is the output from the fuzzer:
thread '<unnamed>' panicked at 'buffer contains just 0 bytes, but you are trying to consume 13 bytes. Did you forget to call data()?', /home/capitol/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libstd/macros.rs:16:9
here is a unit test to reproduce it:
#[test]
fn crash_on_empty_buffer() {
let data:[u8; 195] = [144, 32, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 125, 13, 125, 125, 93, 125, 125, 93, 125, 13, 13, 125, 125, 45, 45, 45, 45, 45, 66, 69, 71, 73, 78, 32, 80, 71, 80, 32, 77, 69, 83, 83, 65, 71, 69, 45, 45, 45, 45, 45, 125, 13, 125, 125, 93, 125, 125, 93, 125, 13, 13, 125, 125, 45, 0, 0, 0, 0, 0, 0, 0, 0, 125, 205, 21, 1, 21, 21, 21, 1, 1, 1, 1, 21, 149, 21, 21, 21, 21, 32, 4, 141, 141, 141, 141, 202, 74, 11, 125, 8, 21, 50, 50, 194, 48, 147, 93, 174, 23, 23, 23, 23, 23, 23, 147, 147, 147, 23, 23, 23, 23, 23, 23, 48, 125, 125, 93, 125, 13, 125, 125, 125, 93, 125, 125, 13, 13, 125, 125, 13, 13, 93, 125, 13, 125, 45, 125, 125, 45, 45, 66, 69, 71, 73, 78, 32, 80, 71, 45, 45, 125, 10, 45, 45, 0, 0, 10, 45, 45, 210, 10, 0, 0, 87, 0, 0, 0, 150, 10, 0, 0, 241, 87, 45, 0, 0, 121, 121, 10, 10, 21, 58];
let t = sequoia_openpgp_ffi::parse::pgp_packet_parser_from_bytes(core::option::Option::None, &data[0], data.len());
println!("{:?}", t);
}