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

index out of bounds panic when parsing bytes #11

Open
frewsxcv opened this issue Mar 9, 2017 · 0 comments
Open

index out of bounds panic when parsing bytes #11

frewsxcv opened this issue Mar 9, 2017 · 0 comments

Comments

@frewsxcv
Copy link

frewsxcv commented Mar 9, 2017

extern crate flac;

use flac::{ByteStream, Stream};

fn main() {
    let s = Stream::<ByteStream>::from_buffer(b"fLaC\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00H\x01\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\\");
    if let Ok(mut stream) = s {
        let _ = stream.info();
        let _ = stream.metadata();
        let mut iter = stream.iter::<i8>();
        while iter.next().is_some() { }
    }
}
thread 'main' panicked at 'index out of bounds: the len is 0 but the index is 0', /root/.cargo/git/checkouts/flac-34fb57da42139a77/9549bf8/src/utility/macros.rs:9

Found via https://github.com/rust-fuzz/cargo-fuzz

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

1 participant