From a915739887477b28d924ecc8417ee107d125bd6c Mon Sep 17 00:00:00 2001 From: marha Date: Sun, 6 Sep 2009 18:48:27 +0000 Subject: Switched to xorg-server-1.6.99.900.tar.gz --- xorg-server/Xi/selectev.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'xorg-server/Xi/selectev.c') diff --git a/xorg-server/Xi/selectev.c b/xorg-server/Xi/selectev.c index 9c336fce5..031e602ad 100644 --- a/xorg-server/Xi/selectev.c +++ b/xorg-server/Xi/selectev.c @@ -50,8 +50,6 @@ SOFTWARE. * */ -#define NEED_EVENTS -#define NEED_REPLIES #ifdef HAVE_DIX_CONFIG_H #include @@ -60,6 +58,7 @@ SOFTWARE. #include "inputstr.h" /* DeviceIntPtr */ #include "windowstr.h" /* window structure */ #include +#include #include #include "exevents.h" #include "exglobals.h" @@ -68,7 +67,6 @@ SOFTWARE. #include "selectev.h" extern Mask ExtExclusiveMasks[]; -extern Mask ExtValidMasks[]; static int HandleDevicePresenceMask(ClientPtr client, WindowPtr win, @@ -106,10 +104,9 @@ HandleDevicePresenceMask(ClientPtr client, WindowPtr win, if (mask == 0) return Success; - /* We always only use mksidx = MAXDEVICES for events not bound to + /* We always only use mksidx = AllDevices for events not bound to * devices */ - - if (AddExtensionClient (win, client, mask, MAXDEVICES) != Success) + if (AddExtensionClient (win, client, mask, XIAllDevices) != Success) return BadAlloc; RecalculateDeviceDeliverableEvents(win); @@ -157,7 +154,7 @@ ProcXSelectExtensionEvent(ClientPtr client) REQUEST(xSelectExtensionEventReq); REQUEST_AT_LEAST_SIZE(xSelectExtensionEventReq); - if (stuff->length != (sizeof(xSelectExtensionEventReq) >> 2) + stuff->count) + if (stuff->length != bytes_to_int32(sizeof(xSelectExtensionEventReq)) + stuff->count) return BadLength; ret = dixLookupWindow(&pWin, stuff->window, client, DixReceiveAccess); @@ -175,10 +172,13 @@ ProcXSelectExtensionEvent(ClientPtr client) for (i = 0; i < EMASKSIZE; i++) if (tmp[i].dev != NULL) { + if (tmp[i].mask & ~XIAllMasks) { + client->errorValue = tmp[i].mask; + return BadValue; + } if ((ret = SelectForWindow((DeviceIntPtr) tmp[i].dev, pWin, client, - tmp[i].mask, ExtExclusiveMasks[i], - ExtValidMasks[i])) != Success) + tmp[i].mask, ExtExclusiveMasks[i]))!= Success) return ret; } -- cgit v1.2.3