Conversation
ndossche
left a comment
There was a problem hiding this comment.
What a stupid bug.
This changed long-standing behaviour that people may have worked around, and such a workaround can stop working with this new patch.
Perhaps targeting master is better. WDYT?
Maybe 8.5+ ? |
I like that better since we are close to the regular bug-fix closedown of 8.4, and history tells us that complaints come in too late. |
|
|
Sounds good, I'll rebase to 8.5 and merge on weekend. Thanks |
…ndow inflate_init() applies the preset dictionary eagerly for raw streams via inflateSetDictionary(), gated on encoding == PHP_ZLIB_ENCODING_RAW. But encoding is first adjusted by the window size (encoding += 15 - window), so a raw stream with a non-default window no longer equals PHP_ZLIB_ENCODING_RAW and the dictionary is silently dropped; raw streams carry no header and never emit Z_NEED_DICT, so inflate_add()'s deferred path never applies it either. Gate on the pre-adjustment encoding. The deflate side already applies the dictionary unconditionally, so the roundtrip was broken for this case.
0229e61 to
5049109
Compare
inflate_init() applies a preset dictionary eagerly for raw streams, gated on encoding == PHP_ZLIB_ENCODING_RAW, but encoding is first adjusted by the window size (encoding += 15 - window), so a raw stream with a non-default window no longer matches and the dictionary is silently dropped. Raw streams carry no header and never emit Z_NEED_DICT, so the deferred application in inflate_add() never runs either. Gate on the pre-adjustment encoding; the deflate side already applies the dictionary unconditionally, so the roundtrip was broken for this case.