xserver: Branch 'master'

Matthias Hopf mhopf at kemper.freedesktop.org
Tue Nov 28 19:59:22 EET 2006


 os/WaitFor.c |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

New commits:
diff-tree 834e4b079866594b50be64ae79f3cb2a5baa2070 (from 5dbcd34a0a6c0d10dbfea8fdc9d7dfe7a0261b19)
Author: Matthias Hopf <mhopf at suse.de>
Date:   Tue Nov 28 18:57:13 2006 +0100

    Fix potential NULL pointer access in timer code.
    
    https://bugzilla.novell.com/show_bug.cgi?id=223718

diff --git a/os/WaitFor.c b/os/WaitFor.c
index 6109e34..ba227a3 100644
--- a/os/WaitFor.c
+++ b/os/WaitFor.c
@@ -205,15 +205,17 @@ WaitForSomething(int *pClientsReady)
             if (timeout > 0 && timeout > timers->delta + 250) {
                 /* time has rewound.  reset the timers. */
                 CheckAllTimers(now);
-                timeout = timers->expires - now;
             }
 
-            if (timeout < 0)
-                timeout = 0;
-	    waittime.tv_sec = timeout / MILLI_PER_SECOND;
-	    waittime.tv_usec = (timeout % MILLI_PER_SECOND) *
-		               (1000000 / MILLI_PER_SECOND);
-	    wt = &waittime;
+	    if (timers) {
+		timeout = timers->expires - now;
+		if (timeout < 0)
+		    timeout = 0;
+		waittime.tv_sec = timeout / MILLI_PER_SECOND;
+		waittime.tv_usec = (timeout % MILLI_PER_SECOND) *
+				   (1000000 / MILLI_PER_SECOND);
+		wt = &waittime;
+	    }
 	}
 	XFD_COPYSET(&AllSockets, &LastSelectMask);
 #ifdef SMART_SCHEDULE



More information about the xorg-commit mailing list