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

index afd0ca240b0ed092742c71d40c60d260161eb79b..af72b3bc215c6fd548a2b2c319ed82310a1e0e42 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;
        }