#46026 [Asn->Csd]: bz2.decompress/zlib.inflate filter tries to decompress after end of stream
ID: 46026
Updated by: cellog@php.net
Reported By: Keisial at gmail dot com
-Status: Assigned
+Status: Closed
Bug Type: Bzip2 Related
Operating System: *
PHP Version: 5.2CVS-2008-09-08 (snap)
Assigned To: cellog
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
re-fixed in 5.3 and HEAD
Previous Comments:
------------------------------------------------------------------------
[2008-10-11 21:54:13] Keisial at gmail dot com
Wow, thank you very much. :-)
Sorry about the tabs. My editor messed them (I know, I know, real
programmers use butterflies...).
However, consider doing this:
if (SUCCESS == zend_hash_find(HASH_OF(filterparams), "concatenated",
sizeof("concatenated"), (void **) &tmpzval) ) {
- SEPARATE_ZVAL(tmpzval);
- convert_to_boolean_ex(tmpzval);
data->expect_concatenated = Z_LVAL_PP(tmpzval);
- zval_ptr_dtor(tmpzval);
tmpzval = NULL;
}
There were memory corruption problems with the previous patch, and
zval_ptr_dtor seemed to be the source (thanks to rrichards and pajoye
for their help on this on irc). Also, the other zval_ptr_dtor below
(present there since first version by Sara) would be a "good possible
candidate for another possible point of mem corruption".
------------------------------------------------------------------------
[2008-10-11 19:15:22] cellog@php.net
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
fixed in PHP 5.2, 5.3, 6.0. Concatenation was only added in PHP 5.3
and 6.0, as new features cannot be added to PHP 5.2
------------------------------------------------------------------------
[2008-10-11 19:08:35] cellog@php.net
changing summary to reflect addition of zlib problem
------------------------------------------------------------------------
[2008-10-11 18:25:14] cellog@php.net
In the future, please follow 2 important elements of the coding
standards:
1) use tabs instead of spaces
2) always use {} around if/else blocks
I had to waste 15 minutes just getting the patch formatted correctly
before I could even begin testing it. I don't like wasting time.
------------------------------------------------------------------------
[2008-10-11 17:12:10] cellog@php.net
this same bug applies to zlib stream filter, and also happens simply
when trying to read from a filtered stream that contains a limited
amount of compressed data (as in a zip archive with a bz2-compressed
file), as php_stream_fill_read_buffer reads in maxlen data, triggering
the problem you found. I'll try to get this fixed up and put in a few
tests
------------------------------------------------------------------------
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/46026
--
Edit this bug report at http://bugs.php.net/?id=46026&edit=1
Thread (9 messages)