diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-10-04 20:08:44 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-10-05 11:13:37 +0200 |
commit | afb022f0a399799be43a3fd3a1380b6b26350ed4 (patch) | |
tree | 01088c97dbffa1349cc35c290f8f7e5dfe5d4f2b /lotuswordpro/source | |
parent | 19d85ff18f3f27d68908091242eb7e22b85f9e7c (diff) |
ofz: detect infinite loop
Change-Id: Ifc3134401c4ed7c4b17faf282d191ad2bb778746
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123067
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'lotuswordpro/source')
-rw-r--r-- | lotuswordpro/source/filter/lwpfnlayout.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
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 <o3tl/sorted_vector.hxx> LwpFootnoteLayout::LwpFootnoteLayout(LwpObjectHeader const& objHdr, LwpSvStream* pStrm) : LwpTableLayout(objHdr, pStrm) @@ -111,12 +112,16 @@ void LwpFnRowLayout::RegisterStyle() LwpObjectID* pCellID = &GetChildHead(); LwpCellLayout* pCellLayout = dynamic_cast<LwpCellLayout*>(pCellID->obj().get()); + o3tl::sorted_vector<LwpCellLayout*> aSeen; while (pCellLayout) { + aSeen.insert(pCellLayout); pCellLayout->SetFoundry(m_pFoundry); pCellLayout->RegisterStyle(); pCellID = &pCellLayout->GetNext(); pCellLayout = dynamic_cast<LwpCellLayout*>(pCellID->obj().get()); + if (aSeen.find(pCellLayout) != aSeen.end()) + throw std::runtime_error("loop in conversion"); } } |