Detect infinite recursion in user scripts

fixes #10198
This commit is contained in:
Gunnar Beutner 2015-09-23 09:21:45 +02:00
parent eeb01831c0
commit c15c9cce5e
1 changed files with 4 additions and 0 deletions

View File

@ -19,6 +19,7 @@
#include "base/scriptframe.hpp"
#include "base/scriptglobal.hpp"
#include "base/exception.hpp"
using namespace icinga;
@ -71,5 +72,8 @@ void ScriptFrame::PushFrame(ScriptFrame *frame)
m_ScriptFrames.reset(frames);
}
if (frames->size() > 500)
BOOST_THROW_EXCEPTION(ScriptError("Recursion level too deep."));
frames->push(frame);
}