ende76/brotli-rs

Panic while decompressing

frewsxcv opened this issue · 2 comments

extern crate brotli;

use std::io::Read;
use brotli::Decompressor;

fn main() {
    let mut input = vec![];
    let _ = Decompressor::new(&b"\x11\x3f\x00\x00\x24\xb0\xe2\x99\x80\x12".to_vec() as &[u8]).read_to_end(&mut input);
}
coreyf@frewbook-pro /t/meow (master) [101]> cargo run
     Running `target/debug/meow`
thread '<main>' panicked at 'index out of bounds: the len is 255 but the index is 391', ../src/libcollections/vec.rs:1110
Process didn't exit successfully: `target/debug/meow` (exit code: 101)

Crash discovered using afl.rs

The frequency of errors AFL is reporting is decreasing fast :)

I'm just completely amazed how useful this tool is.