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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Wed Jul 7 07:29:24 UTC 2021


 sw/source/filter/ww8/ww8par2.cxx |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit a99fb22b48df4979191af1ff165a668fc4992d52
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Jul 6 19:52:42 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Jul 7 09:28:52 2021 +0200

    ofz#35832 Timeout
    
    Change-Id: I3cd37d3682cf1029e652eae2f38a3dc68b73ef59
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118536
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index ad56049a6e97..2c3a8b3483d9 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -1813,6 +1813,8 @@ WW8TabDesc::WW8TabDesc(SwWW8ImplReader* pIoClass, WW8_CP nStartCp) :
 
     wwSprmParser aSprmParser(m_pIo->GetFib());
 
+    std::set<std::pair<WW8_CP, WW8_CP>> aPrevRes;
+
     // process pPap until end of table found
     do
     {
@@ -2098,9 +2100,10 @@ WW8TabDesc::WW8TabDesc(SwWW8ImplReader* pIoClass, WW8_CP nStartCp) :
                 break;
         }
 
-        if (nStartCp == aRes.nEndPos)
+        auto aBounds(std::make_pair(aRes.nStartPos, aRes.nEndPos));
+        if (!aPrevRes.insert(aBounds).second) //already seen these bounds, infinite loop
         {
-            SAL_WARN("sw.ww8", "WW8TabDesc End same as Start, abandoning to avoid looping");
+            SAL_WARN("sw.ww8", "WW8TabDesc, loop in paragraph property chain");
             break;
         }
         nStartCp = aRes.nEndPos;


More information about the Libreoffice-commits mailing list