Bug #73944 [Com]: dictionary option of intflate_init() does not work

From: Date: Mon, 06 Feb 2017 16:14:42 +0000
Subject: Bug #73944 [Com]: dictionary option of intflate_init() does not work
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-207204@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73944&edit=1 ID: 73944 Comment by: someone dot wanted dot to dot be dot unknown at gmail dot com Reported by: someone dot wanted dot to dot be dot unknown at gmail dot com Summary: dictionary option of intflate_init() does not work Status: Assigned Type: Bug Package: Zlib related Operating System: Windows 10 x64 PHP Version: 7.1.0 Assigned To: bwoebi Block user comment: N Private report: N New Comment: Mark thinks following: > The current PHP code appears to be calling inflateSetDictionary() only if Z_DICT is returned by > deflate. The PHP code should also call inflateSetDictionary() after calling inflateInit2() if raw > inflate is being requested. http://stackoverflow.com/questions/41653663/is-there-something-special-in-windows-mszip-format-or-cfdata-in-cab-files#comment71289866_41658204 Previous Comments: ------------------------------------------------------------------------ [2017-02-01 15:30:09] bwoebi@php.net No idea, still doesn't work. I'd be happy if someone else could look at the relevant code in ext/zlib/zlib.c:764 and following lines... ------------------------------------------------------------------------ [2017-02-01 15:29:44] bwoebi@php.net No idea, still doesn't work. I'd be happy if someone else could look at the relevant code in ext/zlib/zlib.c:764 and following lines... ------------------------------------------------------------------------ [2017-02-01 10:42:31] someone dot wanted dot to dot be dot unknown at gmail dot com Any updates on this? ------------------------------------------------------------------------ [2017-01-27 20:55:25] someone dot wanted dot to dot be dot unknown at gmail dot com Thanks for attention. Can you test other data set? $in = inflate_init(ZLIB_ENCODING_RAW); $a = inflate_add($in, file_get_contents('https://github.com/wapmorgan/CabArchive/releases/download/0.0.1-dev/comp_0-0')); echo '1 block: '.strlen($a).PHP_EOL; $in = inflate_init(ZLIB_ENCODING_RAW, array('dictionary' => $a)); $b = inflate_add($in, file_get_contents('https://github.com/wapmorgan/CabArchive/releases/download/0.0.1-dev/comp_0-1')); echo '2 block: '.($b === false ? 'failed' : strlen($b)).PHP_EOL; ------------------------------------------------------------------------ [2017-01-25 15:24:01] bwoebi@php.net I'm not sure whether I'm doing it right… I've commented these lines out: https://github.com/php/php-src/blob/b38e6a54cf4500780fd8ba68ae66714a0f21dd86/ext/zlib/zlib.c#L767-L780 and called the code with: $in = inflate_init(ZLIB_ENCODING_RAW, array('dictionary' => $a)); but I still get a data error upon subsequent inflate_add() … so not sure whether the repro is broken or something else in the code. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=73944 -- Edit this bug report at https://bugs.php.net/bug.php?id=73944&edit=1

« previous php.bugs (#207204) next »