mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-03 04:13:31 +00:00
[WIN32K]
- Do not dereference hook objects when it's not needed. - Avoid use after free. CORE-8698 #resolve svn path=/trunk/; revision=64954
This commit is contained in:
@@ -1294,12 +1294,14 @@ IntUnhookWindowsHook(int HookId, HOOKPROC pfnFilterProc)
|
||||
{
|
||||
Hook = CONTAINING_RECORD(pElement, HOOK, Chain);
|
||||
|
||||
/* Get the next element now, we might free the hook in what follows */
|
||||
pElement = Hook->Chain.Flink;
|
||||
|
||||
if (Hook->Proc == pfnFilterProc)
|
||||
{
|
||||
if (Hook->head.pti == pti)
|
||||
{
|
||||
IntRemoveHook(Hook);
|
||||
UserDereferenceObject(Hook);
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
@@ -1308,8 +1310,6 @@ IntUnhookWindowsHook(int HookId, HOOKPROC pfnFilterProc)
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
pElement = Hook->Chain.Flink;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
|
||||
Reference in New Issue
Block a user