[Libreoffice-commits] core.git: lotuswordpro/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Tue Oct 5 09:14:10 UTC 2021
lotuswordpro/source/filter/lwpfnlayout.cxx | 5 +++++
1 file changed, 5 insertions(+)
New commits:
commit afb022f0a399799be43a3fd3a1380b6b26350ed4
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Oct 4 20:08:44 2021 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Oct 5 11:13:37 2021 +0200
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 at redhat.com>
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");
}
}
More information about the Libreoffice-commits
mailing list