From afb022f0a399799be43a3fd3a1380b6b26350ed4 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 4 Oct 2021 20:08:44 +0100 Subject: ofz: detect infinite loop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ifc3134401c4ed7c4b17faf282d191ad2bb778746 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123067 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- lotuswordpro/source/filter/lwpfnlayout.cxx | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lotuswordpro') diff --git a/lotuswordpro/source/filter/lwpfnlayout.cxx b/lotuswordpro/source/filter/lwpfnlayout.cxx index fbbdcb6b4873..0cdede0560d4 100644 --- a/lotuswordpro/source/filter/lwpfnlayout.cxx +++ b/lotuswordpro/source/filter/lwpfnlayout.cxx @@ -59,6 +59,7 @@ */ #include "lwpfnlayout.hxx" +#include LwpFootnoteLayout::LwpFootnoteLayout(LwpObjectHeader const& objHdr, LwpSvStream* pStrm) : LwpTableLayout(objHdr, pStrm) @@ -111,12 +112,16 @@ void LwpFnRowLayout::RegisterStyle() LwpObjectID* pCellID = &GetChildHead(); LwpCellLayout* pCellLayout = dynamic_cast(pCellID->obj().get()); + o3tl::sorted_vector aSeen; while (pCellLayout) { + aSeen.insert(pCellLayout); pCellLayout->SetFoundry(m_pFoundry); pCellLayout->RegisterStyle(); pCellID = &pCellLayout->GetNext(); pCellLayout = dynamic_cast(pCellID->obj().get()); + if (aSeen.find(pCellLayout) != aSeen.end()) + throw std::runtime_error("loop in conversion"); } } -- cgit