xserver: Branch 'master' - 4 commits

Keith Packard keithp at kemper.freedesktop.org
Mon Apr 4 11:33:06 PDT 2011


 Xext/geext.c       |    2 +-
 Xi/extinit.c       |    7 +++++--
 Xi/xiquerydevice.c |    3 ++-
 3 files changed, 8 insertions(+), 4 deletions(-)

New commits:
commit 266ea63bc3e052b753c5484fa08dcc4fb67c8952
Author: Matthieu Herrb <matthieu.herrb at laas.fr>
Date:   Fri Apr 1 22:55:57 2011 +0200

    Xi: fix querydevice request swapping
    
    WriteReplyToClient() swaps rep.length, so it can't be used
    on return of WriteReplyToClient(). So save it's value for later
    use.
    
    Signed-off-by: Matthieu Herrb <matthieu.herrb at laas.fr>
    Reviewed-by: Julien Cristau <jcristau at debian.org>

diff --git a/Xi/xiquerydevice.c b/Xi/xiquerydevice.c
index 8b54211..6eea724 100644
--- a/Xi/xiquerydevice.c
+++ b/Xi/xiquerydevice.c
@@ -153,8 +153,9 @@ ProcXIQueryDevice(ClientPtr client)
         }
     }
 
+    len = rep.length * 4;
     WriteReplyToClient(client, sizeof(xXIQueryDeviceReply), &rep);
-    WriteToClient(client, rep.length * 4, ptr);
+    WriteToClient(client, len, ptr);
     free(ptr);
     free(skip);
     return rc;
commit 552c78592c5e5f52fe16e2429f77c63adf398247
Author: Matthieu Herrb <matthieu.herrb at laas.fr>
Date:   Fri Apr 1 22:54:54 2011 +0200

    Xext: fix test on extension number for the swapped case.
    
    Signed-off-by: Matthieu Herrb <matthieu.herrb at laas.fr>
    Reviewed-by: Julien Cristau <jcristau at debian.org>

diff --git a/Xext/geext.c b/Xext/geext.c
index b37c1a0..a6fbb09 100644
--- a/Xext/geext.c
+++ b/Xext/geext.c
@@ -185,7 +185,7 @@ SGEGenericEvent(xEvent* from, xEvent* to)
     xGenericEvent* gefrom = (xGenericEvent*)from;
     xGenericEvent* geto = (xGenericEvent*)to;
 
-    if (gefrom->extension > MAXEXTENSIONS)
+    if ((gefrom->extension & 0x7f) > MAXEXTENSIONS)
     {
         ErrorF("GE: Invalid extension offset for event.\n");
         return;
commit a074e6b6754d6c2706b2b5de54e22cbffc5b1a17
Author: Matthieu Herrb <matthieu.herrb at laas.fr>
Date:   Fri Apr 1 22:53:40 2011 +0200

    Xi: add XI_Focus{In,Out} to swapped events.
    
    Signed-off-by: Matthieu Herrb <matthieu.herrb at laas.fr>
    Reviewed-by: Julien Cristau <jcristau at debian.org>

diff --git a/Xi/extinit.c b/Xi/extinit.c
index 289558f..0b7280d 100644
--- a/Xi/extinit.c
+++ b/Xi/extinit.c
@@ -864,6 +864,8 @@ XI2EventSwap(xGenericEvent *from, xGenericEvent *to)
     {
         case XI_Enter:
         case XI_Leave:
+        case XI_FocusIn:
+        case XI_FocusOut:
             SDeviceLeaveNotifyEvent((xXILeaveEvent*)from, (xXILeaveEvent*)to);
             break;
         case XI_DeviceChanged:
commit 81257377a2d011ce47fba5822df0f7918dea1d72
Author: Matthieu Herrb <matthieu.herrb at laas.fr>
Date:   Fri Apr 1 22:51:48 2011 +0200

    Xi: take XI2 requests into account also for the swapping case.
    
    Signed-off-by: Matthieu Herrb <matthieu.herrb at laas.fr>
    Reviewed-by: Julien Cristau <jcristau at debian.org>

diff --git a/Xi/extinit.c b/Xi/extinit.c
index 46d3459..289558f 100644
--- a/Xi/extinit.c
+++ b/Xi/extinit.c
@@ -49,6 +49,7 @@ SOFTWARE.
  *  Dispatch routines and initialization routines for the X input extension.
  *
  */
+#define ARRAY_SIZE(_a)        (sizeof((_a)) / sizeof((_a)[0]))
 
 #define	 NUMTYPES 15
 
@@ -410,7 +411,7 @@ static int
 ProcIDispatch(ClientPtr client)
 {
     REQUEST(xReq);
-    if (stuff->data > (IREQUESTS + XI2REQUESTS) || !ProcIVector[stuff->data])
+    if (stuff->data > ARRAY_SIZE(ProcIVector) || !ProcIVector[stuff->data])
         return BadRequest;
 
     return (*ProcIVector[stuff->data])(client);
@@ -429,7 +430,7 @@ static int
 SProcIDispatch(ClientPtr client)
 {
     REQUEST(xReq);
-    if (stuff->data > IREQUESTS || !SProcIVector[stuff->data])
+    if (stuff->data > ARRAY_SIZE(SProcIVector) || !SProcIVector[stuff->data])
         return BadRequest;
 
     return (*SProcIVector[stuff->data])(client);


More information about the xorg-commit mailing list