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

Avoid integer overflow when parsing frame bytes. #179

Merged
merged 1 commit into from
Oct 26, 2017

Conversation

frewsxcv
Copy link
Contributor

The following program causes a panic, prior to these changes.

extern crate ws;

fn main() {
    let bytes = b"\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\t\x01\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xb1\n".to_vec();
    let mut data = std::io::Cursor::new(bytes);
    ws::Frame::parse(&mut data);
}

Found via cargo-fuzz.

@housleyjk housleyjk merged commit 124fc93 into housleyjk:master Oct 26, 2017
@frewsxcv frewsxcv deleted the frewsxcv-avoid-overflow branch October 26, 2017 21:00
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

Successfully merging this pull request may close these issues.

2 participants