summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2017-10-07 03:01:41 +0000
committermidipix <writeonce@midipix.org>2017-10-08 00:01:07 -0400
commitc0326715a29563dd6bea9d922a32f9ec2170c1b7 (patch)
tree011931eb3b76070ca029407ccc75c48e4fc7bc93
parent2c5bbc3227abb53c9b51aa1fa9eafe7ab86d359a (diff)
downloadntapi-c0326715a29563dd6bea9d922a32f9ec2170c1b7.tar.bz2
ntapi-c0326715a29563dd6bea9d922a32f9ec2170c1b7.tar.xz
__ntapi_tt_spawn_native_process(): properly handle a null sparams->patharg.
-rw-r--r--src/process/ntapi_tt_spawn_native_process.c12
1 files 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;