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

Infinite loop after decoding error #98

Closed
jongiddy opened this issue Jun 9, 2023 · 0 comments · Fixed by #99
Closed

Infinite loop after decoding error #98

jongiddy opened this issue Jun 9, 2023 · 0 comments · Fixed by #99

Comments

@jongiddy
Copy link
Contributor

jongiddy commented Jun 9, 2023

Similar to behavior in #96 but different enough to warrant its own issue. Notably #97 does not fix this problem.

After a decoding error try_finish goes into an infinite loop:

#[test]
fn write_invalid() {
    let contents = b"BZh\xfb";
    let mut decoder = bzip2::write::BzDecoder::new(Vec::new());
    dbg!(decoder.write(&contents[..]));
    dbg!(decoder.try_finish());
}

I'm explicitly calling try_finish here to show the problem. But since the Drop implementation calls try_finish this cannot be avoided by not calling try_finish.

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 a pull request may close this issue.

1 participant