xserver: Branch 'master' - 2 commits

Peter Hutterer whot at kemper.freedesktop.org
Thu Jul 2 20:42:22 PDT 2009


 dix/devices.c                  |   11 +++++++++--
 hw/xfree86/ramdac/xf86Cursor.c |    3 +--
 2 files changed, 10 insertions(+), 4 deletions(-)

New commits:
commit 97e29ffb5bf04a9d8280f1fa32ceced148503492
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Jul 3 09:52:04 2009 +1000

    xfree86: fix wrong IsMaster() check causing crashes.
    
    Crashes caused by dereferencing NULL if the path was executed for a floating
    slave device.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/hw/xfree86/ramdac/xf86Cursor.c b/hw/xfree86/ramdac/xf86Cursor.c
index b474ff3..6b71f46 100644
--- a/hw/xfree86/ramdac/xf86Cursor.c
+++ b/hw/xfree86/ramdac/xf86Cursor.c
@@ -303,8 +303,7 @@ xf86CursorSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs,
 
     if (pCurs == NullCursor) {	/* means we're supposed to remove the cursor */
         if (ScreenPriv->SWCursor ||
-            !(pDev == inputInfo.pointer || !IsMaster(pDev) &&
-                GetMaster(pDev->u.master, MASTER_POINTER) == inputInfo.pointer))
+            !(GetMaster(pDev, MASTER_POINTER) == inputInfo.pointer))
                 (*ScreenPriv->spriteFuncs->SetCursor)(pDev, pScreen, NullCursor, x, y);
         else if (ScreenPriv->isUp) {
             xf86SetCursor(pScreen, NullCursor, x, y);
commit 50a2a8dc76645d8736f7d712f0ef05f23089407e
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Jul 3 09:18:57 2009 +1000

    Fix IsXtstDevice - returns false positives since 0814f511d5.
    
    Missing check for the value of 'mid' returned false positives if master was
    NULL.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/dix/devices.c b/dix/devices.c
index a99d046..e000f29 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -2625,16 +2625,23 @@ int AllocXtstDevice (ClientPtr client, char* name,
 BOOL
 IsXtstDevice(DeviceIntPtr dev, DeviceIntPtr master)
 {
+    int is_xtst = FALSE;
     int mid;
     void *tmp; /* shut up, gcc! */
 
     if (IsMaster(dev))
-        return FALSE;
+        return is_xtst;
 
     tmp = dixLookupPrivate(&dev->devPrivates, XTstDevicePrivateKey);
     mid = (int)tmp;
 
-    return (!master || mid == master->id);
+    /* deviceid 0 is reserved for XIAllDevices, non-zero mid means xtst
+     * device */
+    if ((!master && mid) ||
+        (master && mid == master->id))
+        is_xtst = TRUE;
+
+    return is_xtst;
 }
 
 /**


More information about the xorg-commit mailing list