From c0326715a29563dd6bea9d922a32f9ec2170c1b7 Mon Sep 17 00:00:00 2001 From: midipix Date: Sat, 7 Oct 2017 03:01:41 +0000 Subject: __ntapi_tt_spawn_native_process(): properly handle a null sparams->patharg. --- src/process/ntapi_tt_spawn_native_process.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/process/ntapi_tt_spawn_native_process.c b/src/process/ntapi_tt_spawn_native_process.c index 811c724..1458e78 100644 --- a/src/process/ntapi_tt_spawn_native_process.c +++ b/src/process/ntapi_tt_spawn_native_process.c @@ -95,11 +95,13 @@ int32_t __stdcall __ntapi_tt_spawn_native_process(nt_spawn_process_params * spar : peb->process_params->cwd_handle; /* patharg */ - patharg = (sparams->patharg[0] == '/') - ? (sparams->patharg[1] == '?') - ? &sparams->patharg[0] - : &sparams->patharg[1] - : &sparams->patharg[0]; + patharg = sparams->patharg + ? (sparams->patharg[0] == '/') + ? (sparams->patharg[1] == '?') + ? &sparams->patharg[0] + : &sparams->patharg[1] + : &sparams->patharg[0] + : 0; /* rtblock, rdata */ rtblock.addr = 0; -- cgit v1.2.3