[haiku-commits] haiku: hrev50759 - src/system/kernel

  • From: mmlr@xxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 12 Dec 2016 11:55:17 +0100 (CET)

hrev50759 adds 1 changeset to branch 'master'
old head: 83cd87d033569de4287ef42ebc10fc6f826695f7
new head: 1f7e5bde38a9b37b51db72450b429b790f2feaa8
overview: 
http://cgit.haiku-os.org/haiku/log/?qt=range&q=1f7e5bde38a9+%5E83cd87d03356

----------------------------------------------------------------------------

1f7e5bde38a9: kernel: Fix NULL dereference in ThreadTimeUserTimer::Schedule().
  
  The SpinLocker was always initialized to fThread->time_lock even though
  fThread may be NULL. This looks like a simple oversight as the rest of
  the method handles fThread being NULL and the team variants of these
  timers have very similar logic and do the NULL check as well.
  
  This fixes the last remaining KDL in the posixtestsuite.

                                            [ Michael Lotz <mmlr@xxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev50759
Commit:      1f7e5bde38a9b37b51db72450b429b790f2feaa8
URL:         http://cgit.haiku-os.org/haiku/commit/?id=1f7e5bde38a9
Author:      Michael Lotz <mmlr@xxxxxxxx>
Date:        Mon Dec 12 10:42:28 2016 UTC

----------------------------------------------------------------------------

1 file changed, 1 insertion(+), 1 deletion(-)
src/system/kernel/UserTimer.cpp | 2 +-

----------------------------------------------------------------------------

diff --git a/src/system/kernel/UserTimer.cpp b/src/system/kernel/UserTimer.cpp
index 8f1514e..9cb843b 100644
--- a/src/system/kernel/UserTimer.cpp
+++ b/src/system/kernel/UserTimer.cpp
@@ -903,7 +903,7 @@ ThreadTimeUserTimer::Schedule(bigtime_t nextTime, bigtime_t 
interval,
        uint32 flags, bigtime_t& _oldRemainingTime, bigtime_t& _oldInterval)
 {
        InterruptsWriteSequentialLocker locker(sUserTimerLock);
-       SpinLocker timeLocker(fThread->time_lock);
+       SpinLocker timeLocker(fThread != NULL ? &fThread->time_lock : NULL);
 
        // get the current time, but only if needed
        bool nowValid = fThread != NULL;


Other related posts:

  • » [haiku-commits] haiku: hrev50759 - src/system/kernel - mmlr