From 1cb5b519a06709e22b99bec75d7bf95020442205 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 4 Jan 2022 21:04:40 +0000 Subject: ofz#42829 Timeout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I7c170fca4601fb0cee8acb28b65ce8bd59595911 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127974 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- lotuswordpro/source/filter/lwpfnlayout.cxx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'lotuswordpro') diff --git a/lotuswordpro/source/filter/lwpfnlayout.cxx b/lotuswordpro/source/filter/lwpfnlayout.cxx index febf995acffc..b91b86a3dab1 100644 --- a/lotuswordpro/source/filter/lwpfnlayout.cxx +++ b/lotuswordpro/source/filter/lwpfnlayout.cxx @@ -244,20 +244,18 @@ LwpVirtualLayout* LwpEnSuperTableLayout::GetMainTableLayout() { LwpObjectID* pID = &GetChildTail(); - LwpVirtualLayout* pPrevLayout = nullptr; + o3tl::sorted_vector aSeen; while (!pID->IsNull()) { LwpVirtualLayout* pLayout = dynamic_cast(pID->obj().get()); - if (!pLayout || pLayout == pPrevLayout) - { + if (!pLayout) break; - } + bool bAlreadySeen = !aSeen.insert(pLayout).second; + if (bAlreadySeen) + throw std::runtime_error("loop in conversion"); if (pLayout->GetLayoutType() == LWP_ENDNOTE_LAYOUT) - { return pLayout; - } pID = &pLayout->GetPrevious(); - pPrevLayout = pLayout; } return nullptr; -- cgit