Skip to content

Commit ffcd366

Browse files
committed
add test
1 parent 6c4fa3b commit ffcd366

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

ext/bz2/tests/gh20620.phpt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
--TEST--
2+
Bug GH-20620 (bzcompress with large source)
3+
--EXTENSIONS--
4+
bz2
5+
--SKIPIF--
6+
<?php if (PHP_INT_SIZE != 8) die('skip this test is for 64bit platforms only');i ?>
7+
--INI--
8+
memory_limit=-1
9+
--FILE--
10+
<?php
11+
try {
12+
bzcompress(str_repeat('1', 4295163906));
13+
} catch (\ValueError $e) {
14+
echo $e->getMessage(), PHP_EOL;
15+
}
16+
?>
17+
--EXPECTF--
18+
bzcompress(): Argument #1 ($data) must be less than or equal to %d

0 commit comments

Comments
 (0)