diff options
Diffstat (limited to 'ext/zlib')
-rw-r--r-- | ext/zlib/config0.m4 | 2 | ||||
-rw-r--r-- | ext/zlib/tests/001.phpt | 2 | ||||
-rw-r--r-- | ext/zlib/tests/bug_52944-win.phpt | 24 | ||||
-rw-r--r-- | ext/zlib/tests/bug_52944.phpt | 7 | ||||
-rw-r--r-- | ext/zlib/tests/data.inc | 2 | ||||
-rw-r--r-- | ext/zlib/zlib_filter.c | 12 |
6 files changed, 9 insertions, 40 deletions
diff --git a/ext/zlib/config0.m4 b/ext/zlib/config0.m4 index 25c7f4f420..ebf67cc001 100644 --- a/ext/zlib/config0.m4 +++ b/ext/zlib/config0.m4 @@ -3,7 +3,7 @@ dnl $Id$ dnl PHP_ARG_WITH(zlib,for ZLIB support, -[ --with-zlib[=DIR] Include ZLIB support (requires zlib >= 1.0.9)]) +[ --with-zlib[=DIR] Include ZLIB support (requires zlib >= 1.0.9)]) PHP_ARG_WITH(zlib-dir,if the location of ZLIB install directory is defined, [ --with-zlib-dir=<DIR> Define the location of zlib install directory], no, no) diff --git a/ext/zlib/tests/001.phpt b/ext/zlib/tests/001.phpt index 0c2ca28c78..4850a65a5a 100644 --- a/ext/zlib/tests/001.phpt +++ b/ext/zlib/tests/001.phpt @@ -29,4 +29,4 @@ Strings are equal 100 36864 Strings are equal 5 15 -Strings are equal +Strings are equal
\ No newline at end of file diff --git a/ext/zlib/tests/bug_52944-win.phpt b/ext/zlib/tests/bug_52944-win.phpt deleted file mode 100644 index fa369f8fb4..0000000000 --- a/ext/zlib/tests/bug_52944-win.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Bug #52944 (segfault with zlib filter and corrupted data) ---SKIPIF-- -<?php if (!extension_loaded("zlib")) print "skip"; ?> -<?php -if (substr(PHP_OS, 0, 3) != 'WIN') { - die("skip windows only"); -} ---INI-- -allow_url_fopen=1 ---FILE-- -<?php -require dirname(__FILE__) . "/bug_52944_corrupted_data.inc"; - -$fp = fopen('data://text/plain;base64,' . $data, 'r'); -stream_filter_append($fp, 'zlib.inflate', STREAM_FILTER_READ); -var_dump(fread($fp,1)); -var_dump(fread($fp,1)); -fclose($fp); -echo "Done.\n"; ---EXPECT-- -string(1) "%" -string(1) "C" -Done. diff --git a/ext/zlib/tests/bug_52944.phpt b/ext/zlib/tests/bug_52944.phpt index ed4af3e157..ff82d29cc7 100644 --- a/ext/zlib/tests/bug_52944.phpt +++ b/ext/zlib/tests/bug_52944.phpt @@ -3,9 +3,6 @@ Bug #52944 (segfault with zlib filter and corrupted data) --SKIPIF-- <?php if (!extension_loaded("zlib")) print "skip"; ?> <?php -if (substr(PHP_OS, 0, 3) == 'WIN') { - die("skip not for windows"); -} if (PHP_OS == 'Darwin') { die("skip not for Darwin"); } @@ -13,6 +10,10 @@ if (PHP_OS == 'Darwin') { allow_url_fopen=1 --FILE-- <?php +/* NOTE this test can fail on asm builds of zlib 1.2.5 or + 1.2.7 on at least Windows and Darwin. Using unoptimized + zlib build fixes the issue. */ + require dirname(__FILE__) . "/bug_52944_corrupted_data.inc"; $fp = fopen('data://text/plain;base64,' . $data, 'r'); diff --git a/ext/zlib/tests/data.inc b/ext/zlib/tests/data.inc index fb20f0bcdf..441199ff08 100644 --- a/ext/zlib/tests/data.inc +++ b/ext/zlib/tests/data.inc @@ -85,4 +85,4 @@ That summons thee to heaven or to hell. QUOTE; -?> +?>
\ No newline at end of file diff --git a/ext/zlib/zlib_filter.c b/ext/zlib/zlib_filter.c index 2054ec2ca2..9a59c3a855 100644 --- a/ext/zlib/zlib_filter.c +++ b/ext/zlib/zlib_filter.c @@ -62,10 +62,9 @@ static php_stream_filter_status_t php_zlib_inflate_filter( { php_zlib_filter_data *data; php_stream_bucket *bucket; - size_t consumed = 0, original_out, original_in; + size_t consumed = 0; int status; php_stream_filter_status_t exit_status = PSFS_FEED_ME; - z_stream *streamp; if (!thisfilter || !thisfilter->abstract) { /* Should never happen */ @@ -73,9 +72,6 @@ static php_stream_filter_status_t php_zlib_inflate_filter( } data = (php_zlib_filter_data *)(thisfilter->abstract); - streamp = &(data->strm); - original_in = data->strm.total_in; - original_out = data->strm.total_out; while (buckets_in->head) { size_t bin = 0, desired; @@ -191,10 +187,9 @@ static php_stream_filter_status_t php_zlib_deflate_filter( { php_zlib_filter_data *data; php_stream_bucket *bucket; - size_t consumed = 0, original_out, original_in; + size_t consumed = 0; int status; php_stream_filter_status_t exit_status = PSFS_FEED_ME; - z_stream *streamp; if (!thisfilter || !thisfilter->abstract) { /* Should never happen */ @@ -202,9 +197,6 @@ static php_stream_filter_status_t php_zlib_deflate_filter( } data = (php_zlib_filter_data *)(thisfilter->abstract); - streamp = &(data->strm); - original_in = data->strm.total_in; - original_out = data->strm.total_out; while (buckets_in->head) { size_t bin = 0, desired; |