32286e4
diff -up xorg-server-1.1.1/hw/xfree86/dixmods/extmod/xf86misc.c.jx xorg-server-1.1.1/hw/xfree86/dixmods/extmod/xf86misc.c
32286e4
diff -up xorg-server-1.1.1/hw/xfree86/common/xf86MiscExt.c.jx xorg-server-1.1.1/hw/xfree86/common/xf86MiscExt.c
32286e4
--- xorg-server-1.1.1/hw/xfree86/common/xf86MiscExt.c.jx	2006-07-05 14:31:40.000000000 -0400
32286e4
+++ xorg-server-1.1.1/hw/xfree86/common/xf86MiscExt.c	2007-12-11 15:03:32.000000000 -0500
32286e4
@@ -647,6 +647,10 @@ MiscExtPassMessage(int scrnIndex, const 
32286e4
 
32286e4
     DEBUG_P("MiscExtPassMessage");
32286e4
 
32286e4
+    /* should check this in the protocol, but xf86NumScreens isn't exported */
32286e4
+    if (scrnIndex >= xf86NumScreens)
32286e4
+	return BadValue;
32286e4
+
32286e4
     if (*pScr->HandleMessage == NULL)
32286e4
 	    return BadImplementation;
32286e4
     return (*pScr->HandleMessage)(scrnIndex, msgtype, msgval, retstr);