From ee115bfd8d5f22194736cbc5c172ee1c1de9c4e9 Mon Sep 17 00:00:00 2001 From: Igor Zinkovsky Date: Mon, 19 Sep 2011 16:03:38 -0700 Subject: [PATCH] windows: fail uv_spawn() if options.file is NULL --- src/win/process.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/win/process.c b/src/win/process.c index 64a35690..ed8015e0 100644 --- a/src/win/process.c +++ b/src/win/process.c @@ -845,14 +845,19 @@ static int duplicate_std_handle(uv_loop_t* loop, DWORD id, HANDLE* dup) { int uv_spawn(uv_loop_t* loop, uv_process_t* process, uv_process_options_t options) { int err = 0, keep_child_stdio_open = 0; - wchar_t* path; + wchar_t* path = NULL; int size; BOOL result; - wchar_t* application_path, *application, *arguments, *env, *cwd; + wchar_t* application_path = NULL, *application = NULL, *arguments = NULL, *env = NULL, *cwd = NULL; HANDLE* child_stdio = process->child_stdio; STARTUPINFOW startup; PROCESS_INFORMATION info; + if (!options.file) { + uv_set_error(loop, UV_EINVAL, 0); + return -1; + } + uv_process_init(loop, process); process->exit_cb = options.exit_cb;