]> granicus.if.org Git - php/commitdiff
MFH:- Fixed bug #41904 (proc_open with empty env array)
authorJani Taskinen <jani@php.net>
Fri, 17 Aug 2007 10:42:30 +0000 (10:42 +0000)
committerJani Taskinen <jani@php.net>
Fri, 17 Aug 2007 10:42:30 +0000 (10:42 +0000)
ext/standard/proc_open.c

index df0a8cd83c9340ad496ac3aa89b9b33b13640a37..57dc02d9bee7d9ebc309522c42948eebd53efd98 100644 (file)
@@ -95,6 +95,10 @@ static php_process_env_t _php_array_to_envp(zval *environment, int is_persistent
        cnt = zend_hash_num_elements(Z_ARRVAL_P(environment));
        
        if (cnt < 1) {
+#ifndef PHP_WIN32
+               env.envarray = (char **) pecalloc(1, sizeof(char *), is_persistent);
+#endif
+               env.envp = (char *) pecalloc(4, 1, is_persistent);
                return env;
        }