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 using read_box #2

Closed
frewsxcv opened this issue Oct 26, 2015 · 6 comments
Closed

Panic when using read_box #2

frewsxcv opened this issue Oct 26, 2015 · 6 comments

Comments

@frewsxcv
Copy link
Contributor

extern crate mp4parse;

use std::io::Cursor;

fn main() {
    let mut c = Cursor::new(b"\x00\x00\x00\x04\xa6\x00\x04\xa6".to_vec());
    let mut context = mp4parse::MediaContext::new();
    let _ = mp4parse::read_box(&mut c, &mut context);
}
coreyf@frewbook-pro /t/mp4 (master) [101]> cargo run
   Compiling mp4 v0.1.0 (file:///private/tmp/mp4)
     Running `target/debug/mp4`
thread '<main>' panicked at 'invalid box size', /private/tmp/mp4parse-rust/src/lib.rs:233
Process didn't exit successfully: `target/debug/mp4` (exit code: 101)

panic discovered using afl.rs

@rillian
Copy link
Contributor

rillian commented Oct 26, 2015

Thanks for fuzzing! Can you please attach the test case so we can verify fixes?

@frewsxcv
Copy link
Contributor Author

The test case is in the first codeblock in my original post, unless you're talking about something else?

@rillian
Copy link
Contributor

rillian commented Oct 26, 2015

Oh, right. Sorry, didn't expect the test to be so short!

rillian added a commit that referenced this issue Oct 27, 2015
This is the test case from frewsxcv's fuzzing work,
generated by American Fuzzy Lop's rust support.

#2
@rillian
Copy link
Contributor

rillian commented Oct 27, 2015

Fixed in 9eca3e7. I also included your testcase as a regression test in e97cf8a. Hope that's ok with you, @frewsxcv?

@rillian rillian closed this as completed Oct 27, 2015
@frewsxcv
Copy link
Contributor Author

Sounds great! Should I continue to fuzz or is the project not ready for it yet?

@rillian
Copy link
Contributor

rillian commented Oct 27, 2015

Fuzzing it welcome. We can find some of these panic!s with valid files, but this is more general.

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