summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon TURNEY <jon.turney@dronecode.org.uk>2009-10-03 12:44:50 +0100
committerJon TURNEY <jon.turney@dronecode.org.uk>2009-10-14 20:29:10 +0100
commit22b38f513c93c2f2aea5909878c3c9acae7d35c1 (patch)
tree449f449c98519fb7d5c0896b2d6fa0ecf31f314f
parent1b0dfd8dee639870725d3bd9b70c3bd589d09e5a (diff)
Cygwin/X: Avoid a potential null pointer dereference before input initialization
Avoid a null pointer dereference if WM_MOUSEMOVE occurred before the input device had been initialized (a timing sensitive bug occassionally seen during initialization) Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
-rw-r--r--hw/xwin/winwndproc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/xwin/winwndproc.c b/hw/xwin/winwndproc.c
index d72a5f135..5e8451082 100644
--- a/hw/xwin/winwndproc.c
+++ b/hw/xwin/winwndproc.c
@@ -717,6 +717,10 @@ winWindowProc (HWND hwnd, UINT message,
if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
break;
+ /* We can't do anything without g_pwinPointer */
+ if (g_pwinPointer == NULL)
+ break;
+
/* Has the mouse pointer crossed screens? */
if (s_pScreen != miPointerGetScreen(g_pwinPointer))
miPointerSetScreen (g_pwinPointer, s_pScreenInfo->dwScreen,