[php-src] PR #22381: ext/zlib: honor preset dictionary for raw inflate with non-default window
| From: | iliaal | Date: | Sun, 21 Jun 2026 11:08:17 +0000 |
| Subject: | [php-src] PR #22381: ext/zlib: honor preset dictionary for raw inflate with non-default window | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-36528@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/22381
Author: iliaal
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.