]> granicus.if.org Git - icinga2/commitdiff
Fix null pointer dereference in Timer::AdjustTimers.
authorGunnar Beutner <gunnar.beutner@netways.de>
Mon, 17 Mar 2014 07:41:53 +0000 (08:41 +0100)
committerGunnar Beutner <gunnar.beutner@netways.de>
Mon, 17 Mar 2014 07:41:53 +0000 (08:41 +0100)
Fixes #5783

lib/base/timer.cpp

index 63fbd669d2025902890a275ff6dad0151c89a59d..347b9186f80d30ec57ed7c1c6e09101b24ab4fe8 100644 (file)
@@ -244,6 +244,9 @@ void Timer::AdjustTimers(double adjustment)
        for (it = idx.begin(); it != idx.end(); it++) {
                Timer::Ptr timer = it->lock();
 
+               if (!timer)
+                       continue;
+
                if (abs(now - (timer->m_Next + adjustment)) <
                    abs(now - timer->m_Next)) {
                        timer->m_Next += adjustment;