From 270401c658a5cf30f7d8c0a48ff7a2d6b8f170a6 Mon Sep 17 00:00:00 2001 From: hfiref0x Date: Wed, 16 Jan 2019 14:03:21 +0700 Subject: [PATCH] Update RpcView.cpp Handle OS_ALLOC heap allocation potential failure in InitDecompilerInfo --- RpcView/RpcView.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/RpcView/RpcView.cpp b/RpcView/RpcView.cpp index 43775d8..e6d997b 100644 --- a/RpcView/RpcView.cpp +++ b/RpcView/RpcView.cpp @@ -189,7 +189,9 @@ void NTAPI InitDecompilerInfo(_In_ RpcInterfaceInfo_T* pRpcInterfaceInfo, _Out_ { SymboleLength = ((UINT)wcslen(SymboleName) + 1)*sizeof(WCHAR); pRpcDecompilerInfo->ppProcNameTable[i] = (WCHAR*)OS_ALLOC(SymboleLength); - memcpy(pRpcDecompilerInfo->ppProcNameTable[i], SymboleName, SymboleLength); + if (pRpcDecompilerInfo->ppProcNameTable[i] != NULL) { + memcpy(pRpcDecompilerInfo->ppProcNameTable[i], SymboleName, SymboleLength); + } } } PdbUninit(hPdb);