summaryrefslogtreecommitdiff
path: root/ext/standard/tests/general_functions/bug72306.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/tests/general_functions/bug72306.phpt')
-rw-r--r--ext/standard/tests/general_functions/bug72306.phpt23
1 files changed, 23 insertions, 0 deletions
diff --git a/ext/standard/tests/general_functions/bug72306.phpt b/ext/standard/tests/general_functions/bug72306.phpt
new file mode 100644
index 0000000000..05c25e6f1e
--- /dev/null
+++ b/ext/standard/tests/general_functions/bug72306.phpt
@@ -0,0 +1,23 @@
+--TEST--
+Bug #72306 (Heap overflow through proc_open and $env parameter)
+--FILE--
+<?php
+class moo {
+ function __construct() { $this->a = 0; }
+ function __toString() { return $this->a++ ? str_repeat("a", 0x8000) : "a"; }
+}
+
+$env = array('some_option' => new moo());
+$pipes = array();
+$description = array(
+ 0 => array("pipe", "r"),
+ 1 => array("pipe", "w"),
+ 2 => array("pipe", "r")
+);
+
+$process = proc_open('nothing', $description, $pipes, NULL, $env);
+
+?>
+okey
+--EXPECT--
+okey