Bug #78527 [Opn->Fbk]: zlib deflate bug with windowBits == 8

From: Date: Thu, 12 Sep 2019 09:49:26 +0000
Subject: Bug #78527 [Opn->Fbk]: zlib deflate bug with windowBits == 8
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-222700@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=78527&edit=1

 ID:                 78527
 Updated by:         nikic@php.net
 Reported by:        wcode404 at gmail dot com
 Summary:            zlib deflate bug with windowBits == 8
-Status:             Open
+Status:             Feedback
 Type:               Bug
 Package:            Zlib related
 Operating System:   linux
 PHP Version:        7.3.9
 Block user comment: N
 Private report:     N

 New Comment:

What is the desired change here, given that zlib does not support this? The current behavior seems
appropriate here.


Previous Comments:
------------------------------------------------------------------------
[2019-09-12 09:43:34] wcode404 at gmail dot com

Description:
------------
256-byte windows are broken
https://github.com/madler/zlib/issues/171

Test script:
---------------
$filename = tempnam(sys_get_temp_dir(), 'zlib');

$expected = 'foo';

// write to file the compress content
$context = deflate_init(ZLIB_ENCODING_DEFLATE, ['window' => 8]);
file_put_contents($filename, deflate_add($context, $expected));


// read content from file and uncompress it
$context = inflate_init(ZLIB_ENCODING_DEFLATE, ['window' => 8]);
$actual = inflate_add($context, file_get_contents($filename));

var_dump($expected === $actual);

Expected result:
----------------
bool(true)

Actual result:
--------------
inflate_add(): data error


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=78527&edit=1


Thread (6 messages)

« previous php.bugs (#222700) next »