bug72306.phpt 490 B

1234567891011121314151617181920212223
  1. --TEST--
  2. Bug #72306 (Heap overflow through proc_open and $env parameter)
  3. --FILE--
  4. <?php
  5. class moo {
  6. function __construct() { $this->a = 0; }
  7. function __toString() { return $this->a++ ? str_repeat("a", 0x8000) : "a"; }
  8. }
  9. $env = array('some_option' => new moo());
  10. $pipes = array();
  11. $description = array(
  12. 0 => array("pipe", "r"),
  13. 1 => array("pipe", "w"),
  14. 2 => array("pipe", "r")
  15. );
  16. $process = proc_open('nothing', $description, $pipes, NULL, $env);
  17. ?>
  18. okey
  19. --EXPECT--
  20. okey