]> granicus.if.org Git - php/commitdiff
MFB: Fixed bug #42117 (bzip2.compress loses data in internal buffer)
authorAntony Dovgal <tony2001@php.net>
Fri, 10 Aug 2007 09:00:42 +0000 (09:00 +0000)
committerAntony Dovgal <tony2001@php.net>
Fri, 10 Aug 2007 09:00:42 +0000 (09:00 +0000)
ext/bz2/bz2_filter.c

index cc42b162a199958c260528abafcd79203a95bd50..1eef1c1c404ede6a5200410e50b5037eddf2171a 100644 (file)
@@ -243,8 +243,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;