Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panic when decompressing #3

Closed
frewsxcv opened this issue Oct 25, 2015 · 1 comment
Closed

Panic when decompressing #3

frewsxcv opened this issue Oct 25, 2015 · 1 comment
Assignees
Labels

Comments

@frewsxcv
Copy link
Contributor

extern crate brotli;

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

fn main() {
    let mut input = vec![];
    let _ = Decompressor::new(&b"\xb1".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 '"Encountered unexpected EOF"', /Users/coreyf/.cargo/git/checkouts/brotli-rs-33811c30552ad7ba/master/src/lib.rs:2280
Process didn't exit successfully: `target/debug/meow` (exit code: 101)

Panic discovered using afl.rs

@ende76 ende76 added the bug label Oct 25, 2015
@ende76 ende76 self-assigned this Oct 25, 2015
ende76 added a commit that referenced this issue Oct 25, 2015
@ende76
Copy link
Owner

ende76 commented Oct 25, 2015

Ah yes, thanks again. This was more my inexperience with Rust conventions than anything else. Now, instead of panicking outright, read() properly passes through the possible error conditions.

@ende76 ende76 closed this as completed Oct 25, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants