From aa23b0bd639b5f54ff86f52a1b6515e08b259c83 Mon Sep 17 00:00:00 2001 From: Ulrich Weigand Date: Wed, 10 Mar 1999 13:28:54 +0000 Subject: [PATCH] Bugfix: Allow lpCommandLine == NULL in CreateProcess(). --- loader/module.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/loader/module.c b/loader/module.c index 7abd8bc7f8d..d8bd4f60a84 100644 --- a/loader/module.c +++ b/loader/module.c @@ -837,14 +837,15 @@ BOOL WINAPI CreateProcessA( LPCSTR lpApplicationName, LPSTR lpCommandLine, *p = '\0'; #endif } - if (strlen(name)) { - get_executable_name(lpCommandLine, cmdline, sizeof(cmdline), &p, TRUE); - strcat(cmdline, p); - } else { - get_executable_name(lpCommandLine, name, sizeof(name), &p, TRUE); - strcpy(cmdline, name); - strcat(cmdline, p); - } + if (lpCommandLine) + if (strlen(name)) { + get_executable_name(lpCommandLine, cmdline, sizeof(cmdline), &p, TRUE); + strcat(cmdline, p); + } else { + get_executable_name(lpCommandLine, name, sizeof(name), &p, TRUE); + strcpy(cmdline, name); + strcat(cmdline, p); + } if (!strchr(name, '\\') && !strchr(name, '.')) strcat(name, ".exe"); -- 2.11.4.GIT