From c92891ea03f9a215218e4cfc30ad3f016e8025a5 Mon Sep 17 00:00:00 2001 From: silverf0x Date: Tue, 15 Jan 2019 21:13:03 +0100 Subject: [PATCH] Fix #25: out of bounds read in RpcCoreInit --- RpcCore/RpcCore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RpcCore/RpcCore.c b/RpcCore/RpcCore.c index 76825f7..53187b3 100644 --- a/RpcCore/RpcCore.c +++ b/RpcCore/RpcCore.c @@ -289,7 +289,7 @@ VOID* __fastcall RpcCoreInit(BOOL bForce) if (GetSystemDirectoryW(RpcRuntimePath,_countof(RpcRuntimePath))==0) goto End; StringCbPrintfW(RpcRuntimePath,sizeof(RpcRuntimePath),L"%s\\rpcrt4.dll",RpcRuntimePath); RuntimVersion=GetModuleVersion(RpcRuntimePath); - for (i = 0; i < sizeof(RPC_CORE_RUNTIME_VERSION); i++) + for (i = 0; i < _countof(RPC_CORE_RUNTIME_VERSION); i++) { if (bForce && ((RuntimVersion & 0xFFFFFFFF00000000) == (RPC_CORE_RUNTIME_VERSION[i] & 0xFFFFFFFF00000000))) {