Skip to content

Commit

Permalink
Fix silverf0x#27: incorrect check of function return value in EnumPro…
Browse files Browse the repository at this point in the history
…cess
  • Loading branch information
silverf0x committed Jan 15, 2019
1 parent b495f68 commit 7227826
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions RpcCommon/Misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ BOOL WINAPI EnumProcess(EnumProcessCallbackFn_T EnumProcessCallbackFn,void* pCal
BOOL bContinue=TRUE;

hSnapshot=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);
if (hSnapshot==NULL) goto End;
if (hSnapshot == INVALID_HANDLE_VALUE) goto End;
ProcessEntry.dwSize=sizeof(ProcessEntry);
if (!Process32FirstW(hSnapshot,&ProcessEntry)) goto End;
do
Expand All @@ -61,7 +61,7 @@ BOOL WINAPI EnumProcess(EnumProcessCallbackFn_T EnumProcessCallbackFn,void* pCal

}while(Process32NextW(hSnapshot,&ProcessEntry));
End:
if (hSnapshot!=NULL) CloseHandle(hSnapshot);
if (hSnapshot != INVALID_HANDLE_VALUE) CloseHandle(hSnapshot);
return (bResult);
}

Expand Down

0 comments on commit 7227826

Please sign in to comment.