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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Fri Aug 13 11:06:04 UTC 2021


 sw/source/filter/html/htmlgrin.cxx |    2 +-
 sw/source/filter/html/swhtml.cxx   |   10 +++++-----
 sw/source/filter/html/swhtml.hxx   |    1 +
 3 files changed, 7 insertions(+), 6 deletions(-)

New commits:
commit 4b41880be6894aaa2d2392554e858631278ba320
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Aug 13 08:42:01 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Aug 13 13:05:27 2021 +0200

    ofz#37114 avoid config when fuzzing
    
    Change-Id: I0d0143453d99b6a27267835f7149b3bb1989080d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120415
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx
index 86607b2a95c5..be5677999462 100644
--- a/sw/source/filter/html/htmlgrin.cxx
+++ b/sw/source/filter/html/htmlgrin.cxx
@@ -643,7 +643,7 @@ IMAGE_SETEVENT:
 
     // bPercentWidth / bPercentHeight means we have a percent size.  If that's not the case and we have no
     // size from nWidth / nHeight either, then inspect the image header.
-    if ((!bPercentWidth && !nWidth) && (!bPercentHeight && !nHeight) && allowAccessLink(*m_xDoc))
+    if ((!bPercentWidth && !nWidth) && (!bPercentHeight && !nHeight) && !m_bFuzzing && allowAccessLink(*m_xDoc))
     {
         GraphicDescriptor aDescriptor(aGraphicURL);
         if (aDescriptor.Detect(/*bExtendedInfo=*/true))
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index b79c0d5071ce..122a4ea88213 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -311,13 +311,13 @@ SwHTMLParser::SwHTMLParser( SwDoc* pD, SwPaM& rCursor, SvStream& rIn,
     m_bBodySeen( false ),
     m_bReadingHeaderOrFooter( false ),
     m_bNotifyMacroEventRead( false ),
+    m_bFuzzing(utl::ConfigManager::IsFuzzing()),
     m_isInTableStructure(false),
     m_nTableDepth( 0 ),
     m_pTempViewFrame(nullptr)
 {
-    const bool bFuzzing = utl::ConfigManager::IsFuzzing();
     // If requested explicitly, then force ignoring of comments (don't create postits for them).
-    if (!bFuzzing)
+    if (!m_bFuzzing)
     {
         if (officecfg::Office::Writer::Filter::Import::HTML::IgnoreComments::get())
             m_bIgnoreHTMLComments = true;
@@ -334,7 +334,7 @@ SwHTMLParser::SwHTMLParser( SwDoc* pD, SwPaM& rCursor, SvStream& rIn,
     memset(m_xAttrTab.get(), 0, sizeof(HTMLAttrTable));
 
     // Read the font sizes 1-7 from the INI file
-    if (!bFuzzing)
+    if (!m_bFuzzing)
     {
         m_aFontHeights[0] = officecfg::Office::Common::Filter::HTML::Import::FontSize::Size_1::get() * 20;
         m_aFontHeights[1] = officecfg::Office::Common::Filter::HTML::Import::FontSize::Size_2::get() * 20;
@@ -371,7 +371,7 @@ SwHTMLParser::SwHTMLParser( SwDoc* pD, SwPaM& rCursor, SvStream& rIn,
     m_xDoc->getIDocumentSettingAccess().set(DocumentSettingId::HTML_MODE, true);
 
     m_pCSS1Parser.reset(new SwCSS1Parser(m_xDoc.get(), *this, m_aFontHeights, m_sBaseURL, IsNewDoc()));
-    if (!bFuzzing)
+    if (!m_bFuzzing)
         m_pCSS1Parser->SetIgnoreFontFamily( officecfg::Office::Common::Filter::HTML::Import::FontSetting::get() );
 
     if( bReadUTF8 )
@@ -884,7 +884,7 @@ void SwHTMLParser::Continue( HtmlTokenId nToken )
         }
 
         // adjust AutoLoad in DocumentProperties
-        if (!utl::ConfigManager::IsFuzzing() && IsNewDoc())
+        if (!m_bFuzzing && IsNewDoc())
         {
             SwDocShell *pDocShell(m_xDoc->GetDocShell());
             OSL_ENSURE(pDocShell, "no SwDocShell");
diff --git a/sw/source/filter/html/swhtml.hxx b/sw/source/filter/html/swhtml.hxx
index 0a06c3fac05a..d2b1fad6bca2 100644
--- a/sw/source/filter/html/swhtml.hxx
+++ b/sw/source/filter/html/swhtml.hxx
@@ -469,6 +469,7 @@ class SwHTMLParser : public SfxHTMLParser, public SvtListener
     bool m_bBodySeen : 1;
     bool m_bReadingHeaderOrFooter : 1;
     bool m_bNotifyMacroEventRead : 1;
+    bool m_bFuzzing;
     bool m_isInTableStructure;
 
     sal_Int32 m_nTableDepth;


More information about the Libreoffice-commits mailing list