From: Ilia Alshanetsky Date: Thu, 9 Aug 2007 23:27:22 +0000 (+0000) Subject: Fixed bug #42117 (bzip2.compress loses data in internal buffer) X-Git-Tag: php-5.2.4RC2~53 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6a752ac6df5d4dc425868eae78d5ded46f682f1b;p=php Fixed bug #42117 (bzip2.compress loses data in internal buffer) --- 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;