silverf0x / RpcView

RpcView is a free tool to explore and decompile Microsoft RPC interfaces
GNU General Public License v3.0
895 stars 247 forks source link

RpcView/RpcCoreManager.c RpcCoreInit, potential null pointer dereference #33

Closed hfiref0x closed 5 years ago

hfiref0x commented 5 years ago

There is a potential null pointer dereference in RpcView/RpcCoreManager.c RpcCoreInit function.

The result of OS_ALLOC call is not validated. OS_ALLOC declared as call to HeapAlloc(GetProcessHeap). https://github.com/silverf0x/RpcView/blob/c108da277be48accb3c6aaeb4af752a2028069bf/RpcView/RpcCoreManager.c#L94

If the HeapAlloc fails it return NULL (https://docs.microsoft.com/en-us/windows/desktop/api/heapapi/nf-heapapi-heapalloc#return-value).

Thus in case of HeapAlloc failure null pointer will be dereferenced next.