summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-09-20 10:24:27 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-09-20 12:36:11 +0200
commit1a6401578ec32510342e232699889527cca914b8 (patch)
tree78e68e05ea0dd0ac896745d5a31dd1064ced417e /sw
parente2e43363b429b7909ed3dbe79ccab35d0274106e (diff)
ofz: avoid Timeout
Change-Id: I941a5b9b930248236f35b31582ee8f2c9e0be16e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122348 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/html/swhtml.cxx16
-rw-r--r--sw/source/filter/html/swhtml.hxx1
2 files changed, 14 insertions, 3 deletions
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index 053a3c4177e4..df8abc1e65d9 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -315,6 +315,7 @@ SwHTMLParser::SwHTMLParser( SwDoc* pD, SwPaM& rCursor, SvStream& rIn,
m_isInTableStructure(false),
m_nTableDepth( 0 ),
m_nFloatingFrames( 0 ),
+ m_nListItems( 0 ),
m_pTempViewFrame(nullptr)
{
// If requested explicitly, then force ignoring of comments (don't create postits for them).
@@ -1827,10 +1828,19 @@ void SwHTMLParser::NextToken( HtmlTokenId nToken )
EndPara();
}
- EndNumberBulletListItem( HtmlTokenId::NONE, false );// close <LI>/<LH> and don't set a template
- NewNumberBulletListItem( nToken );
- break;
+ if (m_bFuzzing && m_nListItems > 1024)
+ {
+ SAL_WARN("sw.html", "skipping remaining bullet import for performance during fuzzing");
+ }
+ else
+ {
+ EndNumberBulletListItem( HtmlTokenId::NONE, false );// close <LI>/<LH> and don't set a template
+ NewNumberBulletListItem( nToken );
+ }
+ ++m_nListItems;
+
+ break;
case HtmlTokenId::LI_OFF:
case HtmlTokenId::LISTHEADER_OFF:
EndNumberBulletListItem( nToken, false );
diff --git a/sw/source/filter/html/swhtml.hxx b/sw/source/filter/html/swhtml.hxx
index d4f65b2616a2..6ed83640bad5 100644
--- a/sw/source/filter/html/swhtml.hxx
+++ b/sw/source/filter/html/swhtml.hxx
@@ -474,6 +474,7 @@ class SwHTMLParser : public SfxHTMLParser, public SvtListener
int m_nTableDepth;
int m_nFloatingFrames;
+ int m_nListItems;
/// the names corresponding to the DOCINFO field subtypes INFO[1-4]
OUString m_InfoNames[4];