sw/source/filter/html/swhtml.cxx |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 5a7522d378e080eae4f3558102f0642d6f5fab71
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Wed Aug 31 12:12:36 2022 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Wed Aug 31 20:53:02 2022 +0200

    ofz#39186 avoid Timeout
    
    Change-Id: Ie5b796de7b10893b08ccafdec57dbf60a947128c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139105
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index bb3413d19418..9fcb2e0032dd 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -4628,7 +4628,14 @@ void SwHTMLParser::SetTextCollAttrs( HTMLAttrContext 
*pContext )
     sal_uInt16 nLeftMargin = 0, nRightMargin = 0;   // the margins and
     short nFirstLineIndent = 0;                     // indentations
 
-    for( auto i = m_nContextStAttrMin; i < m_aContexts.size(); ++i )
+    auto nDepth = m_aContexts.size();
+    if (m_bFuzzing && nDepth > 512)
+    {
+        SAL_WARN("sw.html", "Not applying any more text collection attributes 
to a deeply nested node for fuzzing performance");
+        nDepth = 0;
+    }
+
+    for (auto i = m_nContextStAttrMin; i < nDepth; ++i)
     {
         const HTMLAttrContext *pCntxt = m_aContexts[i].get();
 

Reply via email to