ende76 / brotli-rs

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

Panic while decompressing #9

Closed frewsxcv closed 8 years ago

frewsxcv commented 8 years ago
extern crate brotli;

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

fn main() {
    let mut input = vec![];
    let _ = Decompressor::new(&b"\x12\x1b\x00\x1e\x11\x00\x05\x09\x21\x00\x05\x04\x43\x05\xf5\x21\x1e\x11\x00\x05\xf5\x21\x00\x05\x04\x43".to_vec() as &[u8]).read_to_end(&mut input);
}
coreyf@frewbook-pro /t/meow (master)> cargo run
     Running `target/debug/meow`
thread '<main>' panicked at 'arithmetic operation overflowed', /Users/coreyf/.cargo/git/checkouts/brotli-rs-33811c30552ad7ba/master/src/transformation/mod.rs:145
Process didn't exit successfully: `target/debug/meow` (exit code: 101)

Crash discovered using afl.rs