From 7422ef83a1304d34cd303a7160efd4e76cc44a49 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 16 Oct 2021 14:04:35 +0100 Subject: ofz#40004 Timeout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I261f6acec53936e4a644bb4b38bbc41fa9ad120c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123702 Tested-by: Jenkins Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara --- lotuswordpro/source/filter/lwppagelayout.cxx | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lotuswordpro') diff --git a/lotuswordpro/source/filter/lwppagelayout.cxx b/lotuswordpro/source/filter/lwppagelayout.cxx index 0a72db8f7d30..735a0791c2e2 100644 --- a/lotuswordpro/source/filter/lwppagelayout.cxx +++ b/lotuswordpro/source/filter/lwppagelayout.cxx @@ -607,8 +607,11 @@ sal_Int32 LwpPageLayout::GetPageNumber(sal_uInt16 nLayoutNumber) //get first pagehint LwpPageHint* pPageHint = dynamic_cast(pHeadTail->GetHead().obj().get()); + o3tl::sorted_vector aSeen; while (pPageHint) { + aSeen.insert(pPageHint); + if (GetObjectID() == pPageHint->GetPageLayoutID()) { sal_uInt16 nNumber = pPageHint->GetPageNumber(); @@ -635,7 +638,11 @@ sal_Int32 LwpPageLayout::GetPageNumber(sal_uInt16 nLayoutNumber) break; } } + pPageHint = dynamic_cast(pPageHint->GetNext().obj().get()); + + if (aSeen.find(pPageHint) != aSeen.end()) + throw std::runtime_error("loop in conversion"); } if (nPageNumber >= 0) { -- cgit