mirror of
https://github.com/php/php-src.git
synced 2024-09-24 03:17:26 +00:00
e4ff7f2ee3
(chained zlib filters silently fail with large amounts of data) Use the same buffer size zlib uses internally to avoid Z_DATA_ERROR on massively compressed data
27 lines
561 B
PHP
27 lines
561 B
PHP
--TEST--
|
|
Bug #67724 (chained zlib filters silently fail with large amounts of data)
|
|
--SKIPIF--
|
|
<?php
|
|
extension_loaded("zlib") or die("skip need ext/zlib");
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
echo "Test\n";
|
|
|
|
$f = fopen(__DIR__."/bug67724.gz.gz", "rb")
|
|
or die(current(error_get_last()));
|
|
stream_filter_append($f, "zlib.inflate", STREAM_FILTER_READ, ["window" => 30]);
|
|
stream_filter_append($f, "zlib.inflate", STREAM_FILTER_READ, ["window" => 30]);
|
|
for ($i = 0; !feof($f); $i += strlen(fread($f, 0x1000)))
|
|
;
|
|
fclose($f);
|
|
|
|
var_dump($i);
|
|
|
|
?>
|
|
DONE
|
|
--EXPECT--
|
|
Test
|
|
int(25600000)
|
|
DONE
|