[icinga-checkins] icinga.org: icinga2/master: Fix crash in Service::IsReachable().

git at icinga.org git at icinga.org
Thu Feb 28 10:27:47 CET 2013


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

Author: Gunnar Beutner <gunnar.beutner at netways.de>
Date:   Thu Feb 28 10:26:33 2013 +0100

Fix crash in Service::IsReachable().

---

 lib/icinga/service.cpp |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/lib/icinga/service.cpp b/lib/icinga/service.cpp
index f8fdcb0..a951df8 100644
--- a/lib/icinga/service.cpp
+++ b/lib/icinga/service.cpp
@@ -191,6 +191,11 @@ bool Service::IsReachable(const Service::Ptr& self)
 
 	BOOST_FOREACH(const Host::Ptr& host, Service::GetParentHosts(self)) {
 		Service::Ptr hc = Host::GetHostCheckService(host);
+
+		/* ignore hosts that don't have a hostcheck */
+		if (!hc)
+			continue;
+
 		ObjectLock olock(hc);
 
 		/* ignore ourselves */





More information about the icinga-checkins mailing list