From cb907f4f3b50555ee73672c9dcce822b872b7cb0 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Thu, 28 Feb 2013 10:26:33 +0100 Subject: [PATCH] Fix crash in Service::IsReachable(). --- lib/icinga/service.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/icinga/service.cpp b/lib/icinga/service.cpp index f8fdcb059..a951df828 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 */