From 6a752ac6df5d4dc425868eae78d5ded46f682f1b Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Thu, 9 Aug 2007 23:27:22 +0000 Subject: [PATCH] Fixed bug #42117 (bzip2.compress loses data in internal buffer) --- NEWS | 2 ++ ext/bz2/bz2_filter.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index ff434b8f17..51d03aa9c6 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,8 @@ PHP NEWS - Fixed bug #42198 (SCRIPT_NAME and PHP_SELF truncated when inside a userdir and using PATH_INFO). (Dmitry) - Fixed bug #42195 (C++ compiler required always). (Jani) +- Fixed bug #42117 (bzip2.compress loses data in internal buffer). (Philip, + Ilia) - Fixed bug #42082 (NodeList length zero should be empty). (Hannes) - Fixed bug #41973 (./configure --with-ldap=shared fails with LDFLAGS="-Wl,--as-needed"). (Nuno) diff --git a/ext/bz2/bz2_filter.c b/ext/bz2/bz2_filter.c index e29346e567..2e642b3bf8 100644 --- a/ext/bz2/bz2_filter.c +++ b/ext/bz2/bz2_filter.c @@ -228,8 +228,8 @@ static php_stream_filter_status_t php_bz2_compress_filter( if (flags & PSFS_FLAG_FLUSH_CLOSE) { /* Spit it out! */ - status = BZ_OUTBUFF_FULL; - while (status == BZ_OUTBUFF_FULL) { + status = BZ_FINISH_OK; + while (status == BZ_FINISH_OK) { status = BZ2_bzCompress(&(data->strm), BZ_FINISH); if (data->strm.avail_out < data->outbuf_len) { size_t bucketlen = data->outbuf_len - data->strm.avail_out; -- 2.40.0