lotuswordpro/source/filter/lwpdoc.cxx | 4 ++++ lotuswordpro/source/filter/lwprowlayout.cxx | 5 +++++ 2 files changed, 9 insertions(+)
New commits: commit 7a4eaf4a74832621d8ae2525ee93501ed315e590 Author: Caolán McNamara <caol...@redhat.com> Date: Sat Feb 17 14:47:10 2018 +0000 ofz: infinite loop Change-Id: Ie54c22c65ccd962862cade77e3502a264164c2b2 Reviewed-on: https://gerrit.libreoffice.org/49912 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/lotuswordpro/source/filter/lwprowlayout.cxx b/lotuswordpro/source/filter/lwprowlayout.cxx index 8e90b856da45..02d9d221b304 100644 --- a/lotuswordpro/source/filter/lwprowlayout.cxx +++ b/lotuswordpro/source/filter/lwprowlayout.cxx @@ -68,6 +68,7 @@ #include <xfilter/xftable.hxx> #include <xfilter/xfcell.hxx> #include <xfilter/xfcellstyle.hxx> +#include <set> LwpRowLayout::LwpRowLayout(LwpObjectHeader const &objHdr, LwpSvStream* pStrm) : LwpVirtualLayout(objHdr, pStrm) @@ -95,12 +96,16 @@ void LwpRowLayout::SetRowMap() LwpObjectID& rCellID= GetChildHead(); LwpCellLayout * pCellLayout = dynamic_cast<LwpCellLayout *>(rCellID.obj().get()); + std::set<LwpCellLayout*> aSeen; while(pCellLayout) { + aSeen.insert(pCellLayout); pCellLayout->SetCellMap(); rCellID = pCellLayout->GetNext(); pCellLayout = dynamic_cast<LwpCellLayout *>(rCellID.obj().get()); + if (aSeen.find(pCellLayout) != aSeen.end()) + throw std::runtime_error("loop in conversion"); } } /** commit d265bb1554c185ab9cd5bd63e584165e8b3ae0a1 Author: Caolán McNamara <caol...@redhat.com> Date: Sat Feb 17 14:50:30 2018 +0000 ofz: infinite loop Change-Id: Icbc19a6761a9972d61db45b779dab56361bf6db8 Reviewed-on: https://gerrit.libreoffice.org/49915 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/lotuswordpro/source/filter/lwpdoc.cxx b/lotuswordpro/source/filter/lwpdoc.cxx index 6bb3c94aedb5..728df2e413b8 100644 --- a/lotuswordpro/source/filter/lwpdoc.cxx +++ b/lotuswordpro/source/filter/lwpdoc.cxx @@ -562,8 +562,10 @@ LwpDocument* LwpDocument::GetLastDivisionWithContents() { LwpDocument* pDivision = GetLastDivision(); + std::set<LwpDocument*> aSeen; while (pDivision && pDivision != this) { + aSeen.insert(pDivision); LwpDocument* pContentDivision = pDivision->GetLastDivisionWithContents(); if (pContentDivision) { @@ -571,6 +573,8 @@ LwpDocument* LwpDocument::GetLastDivisionWithContents() break; } pDivision = pDivision->GetPreviousDivision(); + if (aSeen.find(pDivision) != aSeen.end()) + throw std::runtime_error("loop in conversion"); } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits