From fa6c7012572093a82c9389682977efff85590719 Mon Sep 17 00:00:00 2001 From: Cyril Brulebois Date: Mon, 1 Mar 2010 02:11:36 +0100 Subject: [PATCH] Fix null pointer dereference in xf86_reload_cursors(). Upon resume, X may try to dereference a null pointer, which has been reported in Debian bug #507916 (http://bugs.debian.org/507916). Jim Paris came up with a patch which solves the problem for him. Here's a (hopefully) fixed version of his patch (without the typo). Cc: Jim Paris Signed-off-by: Cyril Brulebois Reviewed-By: Matthias Hopf Signed-off-by: Keith Packard --- hw/xfree86/modes/xf86Cursors.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xfree86/modes/xf86Cursors.c b/hw/xfree86/modes/xf86Cursors.c index f90ecc227..cfbe7785a 100644 --- a/hw/xfree86/modes/xf86Cursors.c +++ b/hw/xfree86/modes/xf86Cursors.c @@ -609,7 +609,7 @@ xf86_reload_cursors (ScreenPtr screen) cursor_screen_priv = dixLookupPrivate(&screen->devPrivates, xf86CursorScreenKey); /* return if HW cursor is inactive, to avoid displaying two cursors */ - if (!cursor_screen_priv->isUp) + if (!cursor_screen_priv || !cursor_screen_priv->isUp) return; scrn = xf86Screens[screen->myNum];