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 in bug when parsing malformed file #64

Closed
5225225 opened this issue Jan 22, 2022 · 4 comments · Fixed by #65
Closed

Panic in bug when parsing malformed file #64

5225225 opened this issue Jan 22, 2022 · 4 comments · Fixed by #65

Comments

@5225225
Copy link

5225225 commented Jan 22, 2022

#[test]
fn test_bug() {
    let input = b"\x04\x04\x04\x05:\x1az*\xfc\x06\x01\x90\x01\x06\x01";
    let mut decoder = Decoder::new(&input[..]);
                                                                        
    let result = io::copy(&mut decoder, &mut io::sink());
}
thread 'deflate::decode::tests::test_bug' panicked at 'bug', src/huffman.rs:124:43
@sile
Copy link
Owner

sile commented Jan 23, 2022

Thank you for creating this issue.
I'll start investigating this problem within a week.
BTW, there are multiple "Decoder" structs in libflate ( https://docs.rs/libflate/latest/libflate/?search=decoder ). So could you give me the module name of the above Decoder struct?

@5225225
Copy link
Author

5225225 commented Jan 23, 2022

Ah, my bad. I put that test in deflate/decode.rs, it's the DEFLATE decoder.

@sile
Copy link
Owner

sile commented Jan 24, 2022

Thank you!

@sile
Copy link
Owner

sile commented Jan 25, 2022

Fixed in #65. Thanks again for reporting this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants