mirror of
https://github.com/danog/ext-uv.git
synced 2024-11-26 20:14:47 +01:00
spawn: fix segv
This commit is contained in:
parent
03e577c827
commit
74a64409dc
@ -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();
|
||||
|
4
php_uv.c
4
php_uv.c
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user