Author: tkreuzer
Date: Wed Oct 27 12:51:32 2010
New Revision: 49303
URL:
http://svn.reactos.org/svn/reactos?rev=49303&view=rev
Log:
[WIN32K]
Fix possible NULL pointer dereference. Spotted by Amine Khaldi.
Modified:
trunk/reactos/subsystems/win32/win32k/ntuser/event.c
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/event.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/event.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/event.c [iso-8859-1] Wed Oct 27 12:51:32
2010
@@ -299,17 +299,21 @@
UserEnterExclusive();
/* Validate input */
- if (hWnd && (hWnd != INVALID_HANDLE_VALUE) && !(Window =
UserGetWindowObject(hWnd)))
- {
- UserLeave();
- return;
+ if (hWnd && (hWnd != INVALID_HANDLE_VALUE))
+ {
+ 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();
}