Fix for #73944 bug#2580
Fix for #73944 bug#2580wapmorgan wants to merge 2 commits intophp:masterfrom wapmorgan:fix_zlib_dictionary
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