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

Caolán McNamara caolanm at redhat.com
Wed Nov 22 15:21:07 UTC 2017


 embeddedobj/source/commonembedding/persistence.cxx |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 366e35799d8c4d9ef871edbb592747b0f4d7ef70
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Nov 22 13:19:26 2017 +0000

    fuzzing: common case of embedded charts in docx
    
    Change-Id: Idc6fdc221ce60e33e6b9fcb1689840dd96570d6b
    Reviewed-on: https://gerrit.libreoffice.org/45089
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/embeddedobj/source/commonembedding/persistence.cxx b/embeddedobj/source/commonembedding/persistence.cxx
index 07bc635a44a4..ab171e3a478b 100644
--- a/embeddedobj/source/commonembedding/persistence.cxx
+++ b/embeddedobj/source/commonembedding/persistence.cxx
@@ -56,6 +56,7 @@
 #include <comphelper/namedvaluecollection.hxx>
 
 #include <tools/diagnose_ex.h>
+#include <unotools/configmgr.hxx>
 #include "persistence.hxx"
 
 using namespace ::com::sun::star;
@@ -440,9 +441,15 @@ OUString OCommonEmbeddedObject::GetFilterName( sal_Int32 nVersion ) const
     OUString aFilterName = GetPresetFilterName();
     if ( aFilterName.isEmpty() )
     {
+        OUString sDocumentServiceName = GetDocumentServiceName();
+        if (utl::ConfigManager::IsFuzzing() && nVersion == SOFFICE_FILEFORMAT_CURRENT &&
+            sDocumentServiceName == "com.sun.star.chart2.ChartDocument")
+        {
+            return "chart8";
+        }
         try {
             ::comphelper::MimeConfigurationHelper aHelper( m_xContext );
-            aFilterName = aHelper.GetDefaultFilterFromServiceName( GetDocumentServiceName(), nVersion );
+            aFilterName = aHelper.GetDefaultFilterFromServiceName(sDocumentServiceName, nVersion);
 
             // If no filter is found, fall back to the FileFormatVersion=6200 filter, Base only has that.
             if (aFilterName.isEmpty() && nVersion == SOFFICE_FILEFORMAT_CURRENT)


More information about the Libreoffice-commits mailing list