[icinga-checkins] icinga.org: icinga2/master: Fix crash with empty ScheduledDowntime 'ranges ' attribute

git at icinga.org git at icinga.org
Tue May 17 11:44:09 CEST 2016


Module: icinga2
Branch: master
Commit: 418636f7dab84c988b46b8316de52715780cd1fb
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=418636f7dab84c988b46b8316de52715780cd1fb

Author: Michael Friedrich <michael.friedrich at netways.de>
Date:   Fri Apr 22 11:00:21 2016 +0200

Fix crash with empty ScheduledDowntime 'ranges' attribute

fixes #11158

---

 lib/icinga/scheduleddowntime.cpp |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/icinga/scheduleddowntime.cpp b/lib/icinga/scheduleddowntime.cpp
index c67bb10..4c03f45 100644
--- a/lib/icinga/scheduleddowntime.cpp
+++ b/lib/icinga/scheduleddowntime.cpp
@@ -131,6 +131,9 @@ std::pair<double, double> ScheduledDowntime::FindNextSegment(void)
 
 	Dictionary::Ptr ranges = GetRanges();
 
+	if (!ranges)
+		return std::make_pair(0, 0);
+
 	Array::Ptr segments = new Array();
 
 	Dictionary::Ptr bestSegment;



More information about the icinga-checkins mailing list