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 in deflate::compress_to_vec() on empty or one-byte slices #75

Closed
Vlad-Shcherbina opened this issue Mar 26, 2020 · 3 comments

Comments

@Vlad-Shcherbina
Copy link

To reproduce, run the following program (with miniz_oxide 0.3.6):

fn main() {
    miniz_oxide::deflate::compress_to_vec(&[], 6);
}

Expected result: it should terminate instantly.
Actual result: it does not terminate.


Same for

fn main() {
    miniz_oxide::deflate::compress_to_vec(&[0], 6);
}
@oyvindln
Copy link
Collaborator

oyvindln commented Apr 2, 2020

Ah somehow missed this issue being posted, will look into it.

oyvindln added a commit that referenced this issue Apr 11, 2020
Fixed bug causing an infinite loop when compress_to_vec was called with empty or 1-length input.

Closes #75
@Lokathor
Copy link
Contributor

Lokathor commented Apr 27, 2020

Hey I just also hit this bug. Can we get a minor patch release to the crate so the fix is on crates.io?

@oyvindln
Copy link
Collaborator

Yeah, was hoping to get the fix for #74 as well, but haven't got confirmation on it yet.

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

3 participants