-
Notifications
You must be signed in to change notification settings - Fork 8k
Fix for #73944 bug #2580
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
Fix for #73944 bug #2580
Conversation
…dictionary if raw compression used
|
Could you clarify what the |
|
These files are MSZip. They can be found in any .cab file using MSZip compression. |
|
Can you please add your test-case from the PR description as a phpt test? @bwoebi You might want to review this. |
|
That looks pretty much fine, I can merge that with a phpt test attached. |
|
Can I include these raw files |
|
It's totally fine to add fixture files as needed. |
|
Where I should put fixtures and what names it should have? |
|
Ok, I've added test to ext/zlib/tests as bug73944.phpt, bug73944_fixture1 and bug73944_fixture2. |
|
Looks like this got merged into 7.0+ as cd1869b yesterday, so closing here. |
Original thread: https://bugs.php.net/bug.php?id=73944
Description:
I'm writing an unpacker of MSZIP blocks that use deflate compression.
I faced a problem and created a question on stackoverflow (http://stackoverflow.com/questions/41653663/is-there-something-special-in-windows-mszip-format-or-cfdata-in-cab-files), where maintainer of zlib library adviced to use
dictionaryoption to pass raw uncompressed data of previous block to decompress next block of data. But in fact that this option doesn't work correctly in php.Test script:
Expected result:
Actual result:
What I've done
inflate_addif it's a string. As told Mark Adlerinflate_initif compression method is raw.If used raw method,
Z_NEED_DICTwill not be returned so php will not use dictionary at all.Result after this patch, applied to master