diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c index 405bfc7d5b5..c0e27fcb530 100644 --- a/dlls/kernel32/process.c +++ b/dlls/kernel32/process.c @@ -898,6 +898,13 @@ static void start_process( void *arg ) entry = (LPTHREAD_START_ROUTINE)((char *)peb->ImageBaseAddress + nt->OptionalHeader.AddressOfEntryPoint); + if (!nt->OptionalHeader.AddressOfEntryPoint) + { + ERR( "%s doesn't have an entry point, it cannot be executed\n", + debugstr_w(peb->ProcessParameters->ImagePathName.Buffer) ); + ExitThread( 1 ); + } + if (TRACE_ON(relay)) DPRINTF( "%04x:Starting process %s (entryproc=%p)\n", GetCurrentThreadId(), debugstr_w(peb->ProcessParameters->ImagePathName.Buffer), entry );