bug74600.phpt 866 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. proc_terminate($proc);
  29. proc_close($proc);
  30. ?>
  31. --CLEAN--
  32. <?php
  33. unlink(__DIR__ . "/bug74600.ini");
  34. ?>
  35. --EXPECT--
  36. string(4) "okey"
  37. string(0) ""