#40189 [Csd->Opn]: endless loop in zlib.inflate stream filter
ID: 40189
Updated by: cellog@php.net
Reported By: cellog@php.net
-Status: Closed
+Status: Open
Bug Type: Zlib Related
Operating System: kubuntu linux
PHP Version: 5CVS-2007-01-22 (CVS)
-Assigned To: pollita
+Assigned To: cellog
New Comment:
the fix for this bug unfortunately is incorrect, and can result in
truncation of valid gzipped data. The correct fix is to look for
Z_STREAM_END and to flush if it is returned. Currently, Z_OK and
Z_STREAM_END are treated identically. I need to look at bz2 and see if
the same fix needs to happen there.
Previous Comments:
------------------------------------------------------------------------
[2007-01-25 12:22:56] tony2001@php.net
Patch committed (+ I ported the same patch to ext/bz2).
------------------------------------------------------------------------
[2007-01-23 23:58:53] cellog@php.net
last detail: I have a 64-bit machine, not sure if that
matters or not, but there you go
------------------------------------------------------------------------
[2007-01-23 23:57:55] cellog@php.net
not sure what this cvs update -f business was. Forget
that. Use this to reproduce the bug:
cd pecl/phar
cvs update -D "Jan 22 01:00:00 2007 UTC"
ln -s ~/php5/ext/phar ~/pecl/phar
cd ~/php5
./configure --enable-debug --enable-phar --with-zlib
make cli
cd ext/phar/tests
~/php5/sapi/cli/php phar_ctx_001.phpt
~/php5/sapi/cli/php phar_ctx_001.phpt
or
~/php5/sapi/cli/php phar_oo_compressed_001.phpt
~/php5/sapi/cli/php phar_oo_compressed_001.phpt
(sometimes it only happened on the 2nd run for me)
------------------------------------------------------------------------
[2007-01-22 14:44:59] cellog@php.net
cvs update -f "Jan 22 02:07:44 2007 UTC"
I committed a workaround for the failure, completely
forgetting you needed the file for this bug, sorry. This
is the patch that needs to be reversed:
http://cvs.php.net/viewvc.cgi/pecl/phar/phar.c?r1=1.135&r2=1.136
------------------------------------------------------------------------
[2007-01-22 09:46:45] tony2001@php.net
I have to say, I can't reproduce it on my Suse either.
4 tests fail, but the ones you mentioned work fine.
Btw, phar_oo_compressed_001.phpt fails because of several leaks:
016+ /local/dev/php/5_2/main/streams/streams.c(386) : Stream of type
'MEMORY' 0x40203094 (path:(null)) was not closed
017+ /local/dev/php/5_2/main/streams/streams.c(386) : Stream of type
'TEMP' 0x402004f8 (path:(null)) was not closed
You need to close those streams when destroying the object.
------------------------------------------------------------------------
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
http://bugs.php.net/40189
--
Edit this bug report at http://bugs.php.net/?id=40189&edit=1
Thread (10 messages)