summaryrefslogtreecommitdiff
path: root/ext/zlib
diff options
context:
space:
mode:
authorGreg Beaver <cellog@php.net>2008-01-12 22:04:03 +0000
committerGreg Beaver <cellog@php.net>2008-01-12 22:04:03 +0000
commit1d28516b79fd3e582a1a6e1529a83bb127a5a1ee (patch)
tree7285987821268776ce7783a7bb7ab7286f7d16ed /ext/zlib
parentee16647cfdcd97635ce128ab8c5928884a3789f8 (diff)
downloadphp-git-1d28516b79fd3e582a1a6e1529a83bb127a5a1ee.tar.gz
MFH: far better fix for bug #40189
Diffstat (limited to 'ext/zlib')
-rw-r--r--ext/zlib/zlib_filter.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/ext/zlib/zlib_filter.c b/ext/zlib/zlib_filter.c
index 80359498ec..789d22fcb8 100644
--- a/ext/zlib/zlib_filter.c
+++ b/ext/zlib/zlib_filter.c
@@ -100,7 +100,7 @@ static php_stream_filter_status_t php_zlib_inflate_filter(
consumed += desired;
bin += desired;
- if (status == Z_STREAM_END || data->strm.avail_out < data->outbuf_len) {
+ if (data->strm.avail_out < data->outbuf_len) {
php_stream_bucket *out_bucket;
size_t bucketlen = data->outbuf_len - data->strm.avail_out;
out_bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC);
@@ -108,14 +108,12 @@ static php_stream_filter_status_t php_zlib_inflate_filter(
data->strm.avail_out = data->outbuf_len;
data->strm.next_out = data->outbuf;
exit_status = PSFS_PASS_ON;
- if (status == Z_STREAM_END) {
- /* no more data to decompress, and nothing was spat out */
- if (data->strm.avail_out >= data->outbuf_len) {
- php_stream_bucket_delref(bucket TSRMLS_CC);
- }
- return PSFS_PASS_ON;
- }
+ } else if (status == Z_STREAM_END && data->strm.avail_out >= data->outbuf_len) {
+ /* no more data to decompress, and nothing was spat out */
+ php_stream_bucket_delref(bucket TSRMLS_CC);
+ return PSFS_PASS_ON;
}
+
}
php_stream_bucket_delref(bucket TSRMLS_CC);
}