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 decoding ICO #477

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

Panic when decoding ICO #477

frewsxcv opened this issue Oct 27, 2015 · 1 comment

Comments

@frewsxcv
Copy link
Contributor

extern crate image;

use std::io::Cursor;

fn main() {
    let input = b"\x30\x30\x30\x30\x04\x00\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\xb6\x00\x00\x00\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x00\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x0c\x00\x00\x00\x30\x30\x30\x30\x30\x30\x08\x00".to_vec();
    let c = Cursor::new(input);
    let _ = image::ico::ICODecoder::new(c);
}
coreyf@frewbook-pro /t/imagee (master) [101]> cargo run
   Compiling imagee v0.1.0 (file:///private/tmp/imagee)
     Running `target/debug/imagee`
thread '<main>' panicked at 'index out of bounds: the len is 0 but the index is 0', ../src/libcollections/vec.rs:1110
Process didn't exit successfully: `target/debug/imagee` (exit code: 101)

found using afl.rs

@philipc
Copy link
Contributor

philipc commented May 30, 2016

Closed by #535

@philipc philipc closed this as completed May 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants