summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/standard/proc_open.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c
index 95740a1d91..6f4d88e942 100644
--- a/ext/standard/proc_open.c
+++ b/ext/standard/proc_open.c
@@ -677,6 +677,16 @@ PHP_FUNCTION(proc_open)
}
#ifdef PHP_WIN32
+ if (cwd == NULL) {
+ char cur_cwd[MAXPATHLEN];
+ char *getcwd_result;
+ getcwd_result = VCWD_GETCWD(cur_cwd, MAXPATHLEN);
+ if (!getcwd_result) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot get current directory");
+ goto exit_fail;
+ }
+ }
+
memset(&si, 0, sizeof(si));
si.cb = sizeof(si);
si.dwFlags = STARTF_USESTDHANDLES;