mirror of
https://github.com/neovim/neovim.git
synced 2025-01-01 17:23:36 -07:00
job: Fix crash when passing a non-executable path to job_start
This commit is contained in:
parent
551b76c516
commit
3f15d34056
@ -197,6 +197,12 @@ Job *job_start(char **argv,
|
|||||||
job->stdio[2].flags = UV_CREATE_PIPE | UV_WRITABLE_PIPE;
|
job->stdio[2].flags = UV_CREATE_PIPE | UV_WRITABLE_PIPE;
|
||||||
job->stdio[2].data.stream = (uv_stream_t *)&job->proc_stderr;
|
job->stdio[2].data.stream = (uv_stream_t *)&job->proc_stderr;
|
||||||
|
|
||||||
|
// Give all handles a reference to the job
|
||||||
|
handle_set_job((uv_handle_t *)&job->proc, job);
|
||||||
|
handle_set_job((uv_handle_t *)&job->proc_stdin, job);
|
||||||
|
handle_set_job((uv_handle_t *)&job->proc_stdout, job);
|
||||||
|
handle_set_job((uv_handle_t *)&job->proc_stderr, job);
|
||||||
|
|
||||||
// Spawn the job
|
// Spawn the job
|
||||||
if (uv_spawn(uv_default_loop(), &job->proc, &job->proc_opts) != 0) {
|
if (uv_spawn(uv_default_loop(), &job->proc, &job->proc_opts) != 0) {
|
||||||
free_job(job);
|
free_job(job);
|
||||||
@ -204,12 +210,6 @@ Job *job_start(char **argv,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Give all handles a reference to the job
|
|
||||||
handle_set_job((uv_handle_t *)&job->proc, job);
|
|
||||||
handle_set_job((uv_handle_t *)&job->proc_stdin, job);
|
|
||||||
handle_set_job((uv_handle_t *)&job->proc_stdout, job);
|
|
||||||
handle_set_job((uv_handle_t *)&job->proc_stderr, job);
|
|
||||||
|
|
||||||
job->in = wstream_new(maxmem);
|
job->in = wstream_new(maxmem);
|
||||||
wstream_set_stream(job->in, (uv_stream_t *)&job->proc_stdin);
|
wstream_set_stream(job->in, (uv_stream_t *)&job->proc_stdin);
|
||||||
// Start the readable streams
|
// Start the readable streams
|
||||||
|
Loading…
Reference in New Issue
Block a user