summaryrefslogtreecommitdiff
path: root/ext/bz2/bz2_filter.c
diff options
context:
space:
mode:
authorGreg Beaver <cellog@php.net>2008-01-12 22:03:32 +0000
committerGreg Beaver <cellog@php.net>2008-01-12 22:03:32 +0000
commit4f17800e3244f7183a39febcb12b2b15d0da05c0 (patch)
treeabeafc5c1880a18602d1d50d0e3a52b2ce372934 /ext/bz2/bz2_filter.c
parent79abe24b1b650b6787554caf29676e093ba4086f (diff)
downloadphp-git-4f17800e3244f7183a39febcb12b2b15d0da05c0.tar.gz
far better fix for bug #40189
Diffstat (limited to 'ext/bz2/bz2_filter.c')
-rw-r--r--ext/bz2/bz2_filter.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/ext/bz2/bz2_filter.c b/ext/bz2/bz2_filter.c
index c8fc59ef2f..5c986fc5a8 100644
--- a/ext/bz2/bz2_filter.c
+++ b/ext/bz2/bz2_filter.c
@@ -101,7 +101,7 @@ static php_stream_filter_status_t php_bz2_decompress_filter(
consumed += desired;
bin += desired;
- if (status == BZ_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);
@@ -109,13 +109,10 @@ static php_stream_filter_status_t php_bz2_decompress_filter(
data->strm.avail_out = data->outbuf_len;
data->strm.next_out = data->outbuf;
exit_status = PSFS_PASS_ON;
- if (status == BZ_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 == BZ_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);