From a1bcc248ef10ef8215d864620ca8998957253d80 Mon Sep 17 00:00:00 2001 From: Tsuda Kageyu Date: Mon, 21 Jul 2014 02:10:07 +0900 Subject: [PATCH] Fixed an access violation while removing a hook. --- src/hook.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hook.c b/src/hook.c index d5c7220f..0dc23a51 100644 --- a/src/hook.c +++ b/src/hook.c @@ -116,7 +116,7 @@ struct // returns: >= 0 if the element in contained, < 0 (-insertPos-1) if not static UINT FindHookEntry(LPVOID pTarget) { - UINT left, right; + INT left, right; if (g_hooks.size == 0) return UINT_MAX; @@ -127,7 +127,7 @@ static UINT FindHookEntry(LPVOID pTarget) do { - UINT center = (left + right) / 2; + INT center = (left + right) / 2; if ((ULONG_PTR)g_hooks.pItems[center].pTarget == (ULONG_PTR)pTarget) return center; // found