From: Gunnar Beutner Date: Wed, 23 Mar 2016 08:01:10 +0000 (+0100) Subject: Detect infinite recursion in the zone hierarchy graph X-Git-Tag: v2.5.0~458 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b621b00e3a5ca8863472be258470a5a705594616;p=icinga2 Detect infinite recursion in the zone hierarchy graph fixes #10937 --- diff --git a/lib/remote/zone.cpp b/lib/remote/zone.cpp index f58930c43..d856b7d55 100644 --- a/lib/remote/zone.cpp +++ b/lib/remote/zone.cpp @@ -32,11 +32,16 @@ void Zone::OnAllConfigLoaded(void) m_Parent = Zone::GetByName(GetParentRaw()); Zone::Ptr zone = m_Parent; + int levels = 0; while (zone) { m_AllParents.push_back(zone); zone = Zone::GetByName(zone->GetParentRaw()); + levels++; + + if (levels > 32) + BOOST_THROW_EXCEPTION(ScriptError("Infinite recursion detected while resolving zone graph. Check your zone hierarchy.", GetDebugInfo())); } }