]> granicus.if.org Git - php/commitdiff
wrong file version merged in fix for Bug #40189, here is the correct fix
authorGreg Beaver <cellog@php.net>
Sat, 12 Jan 2008 22:28:04 +0000 (22:28 +0000)
committerGreg Beaver <cellog@php.net>
Sat, 12 Jan 2008 22:28:04 +0000 (22:28 +0000)
ext/zlib/zlib_filter.c

index 03f8bfc282b72dc8d0e89fefb4f12d0545af6dcb..e8936d4f090af0a792dcc39fca6268dc26e1b0f9 100644 (file)
@@ -106,7 +106,7 @@ static php_stream_filter_status_t php_zlib_inflate_filter(
                        data->strm.avail_in = 0;
                        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);
@@ -114,12 +114,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 && 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;
-                               }
+                       } 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;
                        }
+
                }
                consumed += bucket->buflen;
                php_stream_bucket_delref(bucket TSRMLS_CC);