summaryrefslogtreecommitdiff
path: root/x11/modular-xorg-server/patches/patch-ep
blob: 8e1d2aa67cbde19bfe58d35829bb9767237c98f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
$NetBSD: patch-ep,v 1.1 2008/02/25 15:39:16 joerg Exp $

--- hw/xfree86/common/xf86MiscExt.c.orig	2006-11-16 19:01:24.000000000 +0100
+++ hw/xfree86/common/xf86MiscExt.c
@@ -640,6 +640,10 @@ MiscExtPassMessage(int scrnIndex, const 
 
     DEBUG_P("MiscExtPassMessage");
 
+    /* should check this in the protocol, but xf86NumScreens isn't exported */
+    if (scrnIndex >= xf86NumScreens)
+	return BadValue;
+
     if (*pScr->HandleMessage == NULL)
 	    return BadImplementation;
     return (*pScr->HandleMessage)(scrnIndex, msgtype, msgval, retstr);