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

zlib header detection is too restrictive. #27

Open
madler opened this issue Dec 28, 2020 · 3 comments
Open

zlib header detection is too restrictive. #27

madler opened this issue Dec 28, 2020 · 3 comments

Comments

@madler
Copy link

madler commented Dec 28, 2020

This statement looks only for three specific possible zlib headers. There are many more valid zlib headers that would be missed. 61 to be precise. Look at RFC 1950 for the definition of a zlib header.

@ferdymercury
Copy link
Collaborator

Thanks for the report. Bug confirmed.
See also https://stackoverflow.com/questions/9050260/what-does-a-zlib-header-look-like
If you have a patch, please feel free to submit a PR.

@madler
Copy link
Author

madler commented Dec 29, 2020

It looks like you already know to use inflateInit2() with 15+32 in order to auto-detect the format. What you're looking for is already built into zlib's inflate.

@ferdymercury
Copy link
Collaborator

(I am not the author of the software, just an end user / collaborator with admin rights as the original author dropped the project support)

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

No branches or pull requests

2 participants