Skip to content

Commit ef09bc0

Browse files
committed
Added test for bug #74600
1 parent e347b2d commit ef09bc0

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

sapi/cli/tests/bug74600.phpt

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
--TEST--
2+
Bug #74600 (crash (SIGSEGV) in _zend_hash_add_or_update_i)
3+
--SKIPIF--
4+
<?php
5+
if (!getenv("TEST_PHP_EXECUTABLE")) die("skip TEST_PHP_EXECUTABLE not set");
6+
if (substr(PHP_OS, 0, 3) == "WIN") die("skip non windows test");
7+
?>
8+
--FILE--
9+
<?php
10+
$php = getenv("TEST_PHP_EXECUTABLE");
11+
$ini_file = __DIR__ . "/bug74600.ini";
12+
file_put_contents($ini_file, <<<INI
13+
[PHP]\n;\rs=\000\000=\n;\r[PATH\000]\000\376 =\n
14+
INI
15+
);
16+
$desc = array(
17+
0 => array("pipe", "r"),
18+
1 => array("pipe", "w"),
19+
2 => array("pipe", "w"),
20+
);
21+
$pipes = array();
22+
$proc = proc_open("$php -c $ini_file -r 'echo \"okey\";'", $desc, $pipes);
23+
if (!$proc) {
24+
exit(1);
25+
}
26+
var_dump(stream_get_contents($pipes[1]));
27+
var_dump(stream_get_contents($pipes[2]));
28+
29+
proc_terminate($proc);
30+
proc_close($proc);
31+
?>
32+
--EXPECTF--
33+
string(4) "okey"
34+
string(0) ""

0 commit comments

Comments
 (0)