spawn: fix segv

This commit is contained in:
Shuhei Tanuma 2012-07-24 01:00:37 +09:00
parent 03e577c827
commit 74a64409dc
2 changed files with 4 additions and 4 deletions

View File

@ -11,7 +11,7 @@ $stdio[] = uv_stdio_new($out, UV::CREATE_PIPE | UV::WRITABLE_PIPE);
$flags = 0;
uv_spawn(uv_default_loop(), "php", array('-r','var_dump($_ENV);'), $stdio, "/usr/bin/",
array("key"=>"hello"),
array("KEY"=>"hello"),
function($process, $stat, $signal){
uv_close($process,function(){});
@ -23,4 +23,4 @@ uv_read2_start($out, function($out, $nread, $buffer, $stat){
uv_close($out,function(){});
});
uv_run();
uv_run();

View File

@ -4981,7 +4981,7 @@ PHP_FUNCTION(uv_spawn)
uv_process_options_t options = {0};
uv_stdio_container_t *stdio = NULL;
php_uv_t *proc;
zval *zloop, *args, *env, *zoptions, *zstdio = NULL;
zval *zloop, *args, *env, *zoptions = NULL, *zstdio = NULL;
char **command_args, **zenv, *command, *cwd = NULL;
int r = 0, cwd_length = 0, command_len =0, uid = 0, gid = 0, stdio_count = 0;
long flags = 0;
@ -5107,7 +5107,7 @@ PHP_FUNCTION(uv_spawn)
}
if (Z_TYPE_P(zoptions) != IS_NULL){
if (zoptions != NULL && Z_TYPE_P(zoptions) != IS_NULL){
HashTable *opts;
zval **data;