cvs: php-src /ext/bz2 bz2_filter.c /ext/zlib zlib_filter.c
| From: | Antony Dovgal | Date: | Thu, 25 Jan 2007 12:21:24 +0000 |
| Subject: | cvs: php-src /ext/bz2 bz2_filter.c /ext/zlib zlib_filter.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-42877@lists.php.net to get a copy of this message | ||
tony2001 Thu Jan 25 12:21:24 2007 UTC
Modified files:
/php-src/ext/bz2 bz2_filter.c
/php-src/ext/zlib zlib_filter.c
Log:
fix #40189 (possible endless loop in zlib.inflate stream filter)
http://cvs.php.net/viewvc.cgi/php-src/ext/bz2/bz2_filter.c?r1=1.11&r2=1.12&diff_format=u
Index: php-src/ext/bz2/bz2_filter.c
diff -u php-src/ext/bz2/bz2_filter.c:1.11 php-src/ext/bz2/bz2_filter.c:1.12
--- php-src/ext/bz2/bz2_filter.c:1.11 Mon Jan 1 09:29:21 2007
+++ php-src/ext/bz2/bz2_filter.c Thu Jan 25 12:21:24 2007
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: bz2_filter.c,v 1.11 2007/01/01 09:29:21 sebastian Exp $ */
+/* $Id: bz2_filter.c,v 1.12 2007/01/25 12:21:24 tony2001 Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -108,6 +108,11 @@
consumed += desired;
bin += desired;
+ if (!desired) {
+ flags |= PSFS_FLAG_FLUSH_CLOSE;
+ break;
+ }
+
if (data->strm.avail_out < data->outbuf_len) {
php_stream_bucket *out_bucket;
size_t bucketlen = data->outbuf_len - data->strm.avail_out;
http://cvs.php.net/viewvc.cgi/php-src/ext/zlib/zlib_filter.c?r1=1.14&r2=1.15&diff_format=u
Index: php-src/ext/zlib/zlib_filter.c
diff -u php-src/ext/zlib/zlib_filter.c:1.14 php-src/ext/zlib/zlib_filter.c:1.15
--- php-src/ext/zlib/zlib_filter.c:1.14 Mon Jan 1 09:29:35 2007
+++ php-src/ext/zlib/zlib_filter.c Thu Jan 25 12:21:24 2007
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zlib_filter.c,v 1.14 2007/01/01 09:29:35 sebastian Exp $ */
+/* $Id: zlib_filter.c,v 1.15 2007/01/25 12:21:24 tony2001 Exp $ */
#include "php.h"
#include "php_zlib.h"
@@ -106,6 +106,11 @@
data->strm.avail_in = 0;
bin += desired;
+ if (!desired) {
+ flags |= PSFS_FLAG_FLUSH_CLOSE;
+ break;
+ }
+
if (data->strm.avail_out < data->outbuf_len) {
php_stream_bucket *out_bucket;
size_t bucketlen = data->outbuf_len - data->strm.avail_out;