ende76 / brotli-rs

A Brotli implementation in pure and safe Rust
Apache License 2.0
63 stars 19 forks source link

Panic while decompressing #8

Closed frewsxcv closed 9 years ago

frewsxcv commented 9 years ago
extern crate brotli;

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

fn main() {
    let mut input = vec![];
    let _ = Decompressor::new(&b"\x15\x3f\x60\x00\x15\x3f\x60\x00\x27\xb0\xdb\xa8\x80\x25\x27\xb0\xdb\x40\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 'shift operation overflowed', /Users/coreyf/.cargo/git/checkouts/brotli-rs-33811c30552ad7ba/master/src/lib.rs:1162
Process didn't exit successfully: `target/debug/meow` (exit code: 101)

Crash discovered using afl.rs

ende76 commented 9 years ago

Input's getting longer… Maybe there is hope yet.

frewsxcv commented 9 years ago

The next AFL run has been running for about twenty minutes right now and it hasn't found anything. I'm going to sleep and will report back in the morning or whenever it finds something. Great work today!