msvcrt: fix NULL-pointer dereference
Kirill K. Smirnov
lich at math.spbu.ru
Thu Oct 2 17:37:06 CDT 2008
This fixes mingw32-windres.exe
-------------- next part --------------
diff --git a/dlls/msvcrt/process.c b/dlls/msvcrt/process.c
index 9dbc43e..664b11a 100644
--- a/dlls/msvcrt/process.c
+++ b/dlls/msvcrt/process.c
@@ -142,12 +142,12 @@ static MSVCRT_intptr_t msvcrt_spawn(int flags, const MSVCRT_wchar_t* exe, MSVCRT
return -1;
}
- msvcrt_search_executable(exe, fullname, use_path);
+ if (exe != NULL) msvcrt_search_executable(exe, fullname, use_path);
memset(&si, 0, sizeof(si));
si.cb = sizeof(si);
msvcrt_create_io_inherit_block(&si.cbReserved2, &si.lpReserved2);
- if (!CreateProcessW(fullname, cmdline, NULL, NULL, TRUE,
+ if (!CreateProcessW(exe == NULL ? NULL : fullname, cmdline, NULL, NULL, TRUE,
flags == MSVCRT__P_DETACH ? DETACHED_PROCESS : 0,
env, NULL, &si, &pi))
{
More information about the wine-patches
mailing list