MCPcopy Create free account
hub / github.com/Icinga/icinga2 / CheckDepthLimit

Method CheckDepthLimit

lib/base/json.cpp:538–555  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

536}
537
538void JsonSax::CheckDepthLimit() const
539{
540 if (m_Stack.size() >= m_DepthLimit) {
541 std::ostringstream buf;
542 buf << "JSON decoding recursion limit reached (path: root";
543 for (const auto& node : m_Stack) {
544 buf << "[";
545 if (node.m_Dictionary) {
546 buf << JsonEncode(node.m_CurrentKey);
547 } else {
548 buf << node.m_Array->GetLength() - 1;
549 }
550 buf << "]";
551 }
552 buf << ")";
553 BOOST_THROW_EXCEPTION(std::runtime_error(buf.str()));
554 }
555}

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.45
GetLengthMethod · 0.45

Tested by

no test coverage detected