* external.cc (fillout_pinfo): Return NULL rather than 0.
(exit_process): Guard against NULL pointer dereference found by Clang.
This commit is contained in:
@ -108,7 +108,7 @@ fillout_pinfo (pid_t pid, int winpid)
|
||||
{
|
||||
i = 0;
|
||||
pids.reset ();
|
||||
return 0;
|
||||
return NULL;
|
||||
}
|
||||
return &ep;
|
||||
}
|
||||
@ -186,10 +186,12 @@ static void
|
||||
exit_process (UINT status, bool useTerminateProcess)
|
||||
{
|
||||
pid_t pid = getpid ();
|
||||
external_pinfo * ep = fillout_pinfo (pid, 1);
|
||||
external_pinfo *ep = fillout_pinfo (pid, 1);
|
||||
DWORD dwpid = ep ? ep->dwProcessId : pid;
|
||||
pinfo p (pid, PID_MAP_RW);
|
||||
if ((dwpid == GetCurrentProcessId()) && (p->pid == ep->pid))
|
||||
if (ep)
|
||||
pid = ep->pid;
|
||||
if ((dwpid == GetCurrentProcessId()) && (p->pid == pid))
|
||||
p.set_exit_code ((DWORD)status);
|
||||
if (useTerminateProcess)
|
||||
TerminateProcess (GetCurrentProcess(), status);
|
||||
|
Reference in New Issue
Block a user