xserver: Branch 'master'

Keith Packard keithp at kemper.freedesktop.org
Mon Mar 22 10:34:56 PDT 2010


 Xext/saver.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3083c5d0c4386cdd7083b7a83ac72fdad2f1e61e
Author: Michel Dänzer <daenzer at vmware.com>
Date:   Mon Mar 22 18:01:17 2010 +0100

    Xext: Fix cursor reference counting hazard.
    
    Make sure the reference count of the new cursor is increased before the old
    one is decreased, otherwise bad things will happen if they're one and the
    same and the reference count is 1 initially. Not sure this can actually happen
    here, but better safe than sorry.
    
    Signed-off-by: Michel Dänzer <daenzer at vmware.com>
    Reviewed-by: Roland Scheidegger <sroland at vmware.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/Xext/saver.c b/Xext/saver.c
index 2549e8a..aa2e614 100644
--- a/Xext/saver.c
+++ b/Xext/saver.c
@@ -620,10 +620,10 @@ CreateSaverWindow (ScreenPtr pScreen)
     	    	FreeResource (pWin->drawable.id, RT_NONE);
     	    	return FALSE;
 	    }
+	pAttr->pCursor->refcnt++;
 	if (pWin->optional->cursor)
 	    FreeCursor (pWin->optional->cursor, (Cursor)0);
 	pWin->optional->cursor = pAttr->pCursor;
-	pAttr->pCursor->refcnt++;
 	pWin->cursorIsNone = FALSE;
 	CheckWindowOptionalNeed (pWin);
 	mask |= CWCursor;


More information about the xorg-commit mailing list