summaryrefslogtreecommitdiff
path: root/ext/zlib/tests/gzinflate-bug42663.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/zlib/tests/gzinflate-bug42663.phpt')
-rw-r--r--ext/zlib/tests/gzinflate-bug42663.phpt11
1 files changed, 4 insertions, 7 deletions
diff --git a/ext/zlib/tests/gzinflate-bug42663.phpt b/ext/zlib/tests/gzinflate-bug42663.phpt
index 4f0ca9f..dd53c78 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 = '';
-for($i=0; $i<30000; ++$i) $string .= $i . ' ';
+$string = b'';
+for($i=0; $i<30000; ++$i) $string .= (binary)$i . b' ';
var_dump(strlen($string));
// deflate string
$deflated = gzdeflate($string,9);
@@ -15,12 +15,9 @@ var_dump(strlen($deflated));
$truncated = substr($deflated, 0, 65535);
var_dump(strlen($truncated));
// inflate $truncated string (check if it will not eat all memory)
-var_dump(gzinflate($truncated));
+gzinflate($truncated);
?>
---EXPECTF--
+--EXPECT--
int(168890)
int(66743)
int(65535)
-
-Warning: gzinflate(): data error in %s on line %d
-bool(false)