From 91bf7750e667163699614bf354a7dd394e76c658 Mon Sep 17 00:00:00 2001 From: silverf0x Date: Tue, 15 Jan 2019 21:31:40 +0100 Subject: [PATCH] Fix #30: potential null pointer dereference in GetRpcServerAddressInProcess and wWinMain --- RpcCore/RpcCore.c | 1 + RpcView/RpcView.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/RpcCore/RpcCore.c b/RpcCore/RpcCore.c index 53187b3..159b05f 100644 --- a/RpcCore/RpcCore.c +++ b/RpcCore/RpcCore.c @@ -226,6 +226,7 @@ BOOL WINAPI GetRpcServerAddressInProcess(DWORD Pid,RpcCoreInternalCtxt_T* pRpcCo EnumProcessModulesEx(hProcess, NULL, 0, &cbSize, LIST_MODULES_ALL); if (cbSize == 0) goto End; pHmodule = (HMODULE*)malloc(cbSize); + if (pHmodule == NULL) goto End; EnumProcessModulesEx(hProcess, pHmodule, cbSize, &cbSize, LIST_MODULES_ALL); for(ULONG i=0;i