[Libreoffice-commits] core.git: lotuswordpro/source

Caolán McNamara caolanm at redhat.com
Thu Mar 29 10:38:33 UTC 2018


 lotuswordpro/source/filter/lwpstory.cxx |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit 980248e4926b7d24c197084038337e4868badb9c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Mar 29 09:14:34 2018 +0100

    lwp infinite loop
    
    Change-Id: I18506b74ac999893eab1d652b46ee2226f5a3dea
    Reviewed-on: https://gerrit.libreoffice.org/52058
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/lotuswordpro/source/filter/lwpstory.cxx b/lotuswordpro/source/filter/lwpstory.cxx
index 1d81a9334f5c..f52cf6d6ebbe 100644
--- a/lotuswordpro/source/filter/lwpstory.cxx
+++ b/lotuswordpro/source/filter/lwpstory.cxx
@@ -358,13 +358,17 @@ void LwpStory::XFConvertFrameInFrame(XFContentContainer* pCont)
     while (xLayout.get())
     {
         rtl::Reference<LwpVirtualLayout> xFrameLayout(dynamic_cast<LwpVirtualLayout*>(xLayout->GetChildHead().obj().get()));
+        std::set<LwpVirtualLayout*> aSeen;
         while (xFrameLayout.is())
         {
+            aSeen.insert(xFrameLayout.get());
             if (xFrameLayout->IsAnchorFrame())
             {
                 xFrameLayout->DoXFConvert(pCont);
             }
             xFrameLayout.set(dynamic_cast<LwpVirtualLayout*>(xFrameLayout->GetNext().obj().get()));
+            if (aSeen.find(xFrameLayout.get()) != aSeen.end())
+                throw std::runtime_error("loop in register style");
         }
         xLayout = GetLayout(xLayout.get());
     }


More information about the Libreoffice-commits mailing list