diff options
Diffstat (limited to 'ext/zlib/tests/gzinflate-bug42663.phpt')
-rw-r--r-- | ext/zlib/tests/gzinflate-bug42663.phpt | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/ext/zlib/tests/gzinflate-bug42663.phpt b/ext/zlib/tests/gzinflate-bug42663.phpt index dd53c78f4e..4f0ca9fa7f 100644 --- a/ext/zlib/tests/gzinflate-bug42663.phpt +++ b/ext/zlib/tests/gzinflate-bug42663.phpt @@ -5,8 +5,8 @@ Bug #42663 (gzinflate() try to allocate all memory with truncated $data) --FILE-- <?php // build a predictable string -$string = b''; -for($i=0; $i<30000; ++$i) $string .= (binary)$i . b' '; +$string = ''; +for($i=0; $i<30000; ++$i) $string .= $i . ' '; var_dump(strlen($string)); // deflate string $deflated = gzdeflate($string,9); @@ -15,9 +15,12 @@ var_dump(strlen($deflated)); $truncated = substr($deflated, 0, 65535); var_dump(strlen($truncated)); // inflate $truncated string (check if it will not eat all memory) -gzinflate($truncated); +var_dump(gzinflate($truncated)); ?> ---EXPECT-- +--EXPECTF-- int(168890) int(66743) int(65535) + +Warning: gzinflate(): data error in %s on line %d +bool(false) |