Fix possible NULL pointer dereference. Spotted by Amine Khaldi.

svn path=/trunk/; revision=49303
This commit is contained in:
Timo Kreuzer 2010-10-27 12:51:32 +00:00
parent 58781041d7
commit 08810169e7

View file

@ -299,17 +299,21 @@ NtUserNotifyWinEvent(
UserEnterExclusive();
/* Validate input */
if (hWnd && (hWnd != INVALID_HANDLE_VALUE) && !(Window = UserGetWindowObject(hWnd)))
if (hWnd && (hWnd != INVALID_HANDLE_VALUE))
{
UserLeave();
return;
Window = UserGetWindowObject(hWnd);
if (!Window)
{
UserLeave();
return;
}
}
if (gpsi->dwInstalledEventHooks & GetMaskFromEvent(Event))
{
UserRefObjectCo(Window, &Ref);
if (Window) UserRefObjectCo(Window, &Ref);
IntNotifyWinEvent( Event, Window, idObject, idChild, WEF_SETBYWNDPTI);
UserDerefObjectCo(Window);
if (Window) UserDerefObjectCo(Window);
}
UserLeave();
}