[Libreoffice-commits] core.git: 14 commits - writerfilter/source xmloff/source xmlscript/source xmlsecurity/source

Caolán McNamara caolanm at redhat.com
Fri Mar 21 04:14:31 PDT 2014


 writerfilter/source/rtftok/rtfdocumentimpl.cxx |    2 +
 xmloff/source/draw/ximpstyl.cxx                |    2 -
 xmloff/source/style/undlihdl.cxx               |    1 
 xmloff/source/style/xmlbahdl.cxx               |    5 ++-
 xmloff/source/text/XMLTextListBlockContext.cxx |    1 
 xmloff/source/text/txtfldi.cxx                 |   32 ++++++++++++++-----------
 xmloff/source/text/txtparae.cxx                |   11 ++++++--
 xmlscript/source/xmldlg_imexp/exp_share.hxx    |   20 ++++++++++-----
 xmlscript/source/xmldlg_imexp/imp_share.hxx    |   12 +++++++--
 xmlscript/source/xmllib_imexp/imp_share.hxx    |   24 ++++++++++++------
 xmlscript/source/xmlmod_imexp/imp_share.hxx    |   14 +++++++---
 xmlsecurity/source/helper/xsecctl.cxx          |   19 +++++++++-----
 xmlsecurity/source/helper/xsecparser.cxx       |   17 ++++++++-----
 13 files changed, 106 insertions(+), 54 deletions(-)

New commits:
commit 5c291a0287af46558d3ef96d18b114c371ddd31b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 21 11:12:44 2014 +0000

    coverity#736084 Missing break in switch
    
    Change-Id: I3c7a032441402455d0a6ed28fc2cd5ce958ead04

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 7e971a1..776f1de 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -2678,11 +2678,13 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
                 RTFValue::Pointer_t pValue(new RTFValue(1));
                 m_aStates.top().aTableRowSprms.set(NS_ooxml::LN_CT_TrPrBase_cantSplit, pValue);
             }
+            break;
         case RTF_SECTUNLOCKED:
             {
                 RTFValue::Pointer_t pValue(new RTFValue(int(!nParam)));
                 m_aStates.top().aSectionSprms.set(NS_ooxml::LN_EG_SectPrContents_formProt, pValue);
             }
+            break;
         case RTF_PGNDEC:
         case RTF_PGNUCRM:
         case RTF_PGNLCRM:
commit b45270bbfe62102af2300ae6450930d25131f854
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 21 11:07:03 2014 +0000

    coverity#705095 Unchecked dynamic_cast
    
    Change-Id: Ia8291acbba50c492568b11e1eb852e7b84885633

diff --git a/xmloff/source/draw/ximpstyl.cxx b/xmloff/source/draw/ximpstyl.cxx
index 1f1c6f5..3444740 100644
--- a/xmloff/source/draw/ximpstyl.cxx
+++ b/xmloff/source/draw/ximpstyl.cxx
@@ -1608,7 +1608,7 @@ sal_Bool SdXMLHeaderFooterDeclContext::IsTransient() const
 
 void SdXMLHeaderFooterDeclContext::EndElement()
 {
-    SdXMLImport& rImport = *dynamic_cast< SdXMLImport* >( &GetImport() );
+    SdXMLImport& rImport = dynamic_cast<SdXMLImport&>(GetImport());
     if( IsXMLToken( GetLocalName(), XML_HEADER_DECL ) )
     {
         rImport.AddHeaderDecl( maStrName, maStrText );
commit fe0f96e4aafc9ae39fab7bc13e7fd9563ff30cd8
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 21 11:03:45 2014 +0000

    coverity#705345 Missing break in switch
    
    Change-Id: I7ed37e384a0f3bb3863d957ac0333ddc2c7434a3

diff --git a/xmloff/source/style/undlihdl.cxx b/xmloff/source/style/undlihdl.cxx
index 7043194..a2d8da6 100644
--- a/xmloff/source/style/undlihdl.cxx
+++ b/xmloff/source/style/undlihdl.cxx
@@ -209,6 +209,7 @@ bool XMLUnderlineStylePropHdl::importXML( const OUString& rStrImpValue, uno::Any
             case awt::FontUnderline::SINGLE:
                 // keep double or bold line style
                 eNewUnderline = eUnderline;
+                //fall-through
             case awt::FontUnderline::DOTTED:
                 // The line style has priority over a double type.
                 if( awt::FontUnderline::BOLD == eUnderline )
commit 27a8609b2086d232c4d1ff8b92996d638b30cac1
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 21 11:02:12 2014 +0000

    coverity#704114 Unchecked return value
    
    Change-Id: I9f92b4536557d8f6f482d6ce7646125035db3f1d

diff --git a/xmloff/source/style/xmlbahdl.cxx b/xmloff/source/style/xmlbahdl.cxx
index 0a797e5..9d94f6a 100644
--- a/xmloff/source/style/xmlbahdl.cxx
+++ b/xmloff/source/style/xmlbahdl.cxx
@@ -889,10 +889,11 @@ bool XMLNumberWithAutoInsteadZeroPropHdl::exportXML( OUString& rStrExpValue, con
 {
 
     sal_Int32 nValue = 0;
-    lcl_xmloff_getAny( rValue, nValue, 2 );
+    bool bRet = lcl_xmloff_getAny( rValue, nValue, 2 );
+    bRet &= nValue != 0;
 
     // FIXME: 0 is not a valid value - write "auto" instead
-    if (0 == nValue || !rValue.hasValue())
+    if (!bRet)
         rStrExpValue = GetXMLToken( XML_AUTO );
     else
     {
commit a16846dada2dc14fdafe2ddb7535929a0fd97ab9
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 21 10:59:42 2014 +0000

    coverity#705346 Missing break in switch
    
    Change-Id: I80147bd28eedd9d1032cb173a653d4c52a1eb437

diff --git a/xmloff/source/text/XMLTextListBlockContext.cxx b/xmloff/source/text/XMLTextListBlockContext.cxx
index 8e27678..75c8602 100644
--- a/xmloff/source/text/XMLTextListBlockContext.cxx
+++ b/xmloff/source/text/XMLTextListBlockContext.cxx
@@ -268,6 +268,7 @@ SvXMLImportContext *XMLTextListBlockContext::CreateChildContext(
     {
     case XML_TOK_TEXT_LIST_HEADER:
         bHeader = sal_True;
+        //fall-through
     case XML_TOK_TEXT_LIST_ITEM:
         pContext = new XMLTextListItemContext( GetImport(), mrTxtImport,
                                                 nPrefix, rLocalName,
commit 83f2bb7ef645ea01fea021dc5beba5000a5aa359
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 21 10:58:49 2014 +0000

    coverity#704115 Unchecked return value
    
    Change-Id: Ic76d930f3f7a76c93c7b034570297b398497e9b4

diff --git a/xmloff/source/text/txtfldi.cxx b/xmloff/source/text/txtfldi.cxx
index e54b8ea..31a4a97 100644
--- a/xmloff/source/text/txtfldi.cxx
+++ b/xmloff/source/text/txtfldi.cxx
@@ -3654,24 +3654,28 @@ SvXMLImportContext* XMLAnnotationImportContext::CreateChildContext(
     {
         try
         {
+            bool bOK = true;
             if ( !mxField.is() )
-                CreateField( mxField, sServicePrefix + GetServiceName() );
-            Any aAny = mxField->getPropertyValue( sPropertyTextRange );
-            Reference< XText > xText;
-            aAny >>= xText;
-            if( xText.is() )
+                bOK = CreateField( mxField, sServicePrefix + GetServiceName() );
+            if (bOK)
             {
-                UniReference < XMLTextImportHelper > xTxtImport = GetImport().GetTextImport();
-                if( !mxCursor.is() )
+                Any aAny = mxField->getPropertyValue( sPropertyTextRange );
+                Reference< XText > xText;
+                aAny >>= xText;
+                if( xText.is() )
                 {
-                    mxOldCursor = xTxtImport->GetCursor();
-                    mxCursor = xText->createTextCursor();
-                }
+                    UniReference < XMLTextImportHelper > xTxtImport = GetImport().GetTextImport();
+                    if( !mxCursor.is() )
+                    {
+                        mxOldCursor = xTxtImport->GetCursor();
+                        mxCursor = xText->createTextCursor();
+                    }
 
-                if( mxCursor.is() )
-                {
-                    xTxtImport->SetCursor( mxCursor );
-                    pContext = xTxtImport->CreateTextChildContext( GetImport(), nPrefix, rLocalName, xAttrList );
+                    if( mxCursor.is() )
+                    {
+                        xTxtImport->SetCursor( mxCursor );
+                        pContext = xTxtImport->CreateTextChildContext( GetImport(), nPrefix, rLocalName, xAttrList );
+                    }
                 }
             }
         }
commit f5a725abcead37ea63a370d55d6b0d63f25cd271
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 21 10:56:46 2014 +0000

    coverity#705096 Dereference after null check
    
    Change-Id: Ie7eed2a697062f495688dc6325ca52383e049d05

diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index 04bb482..a1315f0 100644
--- a/xmloff/source/text/txtparae.cxx
+++ b/xmloff/source/text/txtparae.cxx
@@ -1061,15 +1061,20 @@ void XMLTextParagraphExport::exportListChange(
         }
     }
 
+    bool bEndElement = false;
+
     if ( rNextInfo.GetLevel() > 0 &&
          rNextInfo.IsNumbered() &&
          rPrevInfo.BelongsToSameList( rNextInfo ) &&
          rPrevInfo.GetLevel() >= rNextInfo.GetLevel() )
     {
-        // close previous list-item
-        DBG_ASSERT( pListElements && pListElements->size() >= 2,
-                "SwXMLExport::ExportListChange: list elements missing" );
+        assert(pListElements && pListElements->size() >= 2); //list elements missing
+        bEndElement = pListElements && pListElements->size() >= 2;
+    }
 
+    if (bEndElement)
+    {
+        // close previous list-item
         GetExport().EndElement(pListElements->back(), sal_True );
         pListElements->pop_back();
 
commit 1f224711746295e6f15d1223792d69bf8971a79b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 21 10:44:09 2014 +0000

    coverity#708728 Uninitialized scalar field
    
    Change-Id: Ic5e22da988f762641daf4cc07f3b2bd0caba36f9

diff --git a/xmlscript/source/xmldlg_imexp/exp_share.hxx b/xmlscript/source/xmldlg_imexp/exp_share.hxx
index bd3aacc..5a42ad3 100644
--- a/xmlscript/source/xmldlg_imexp/exp_share.hxx
+++ b/xmlscript/source/xmldlg_imexp/exp_share.hxx
@@ -53,12 +53,20 @@ struct Style
 
     OUString _id;
 
-    inline Style( short all_ ) SAL_THROW(())
-        : _fontRelief( css::awt::FontRelief::NONE )
-        , _fontEmphasisMark( css::awt::FontEmphasisMark::NONE )
-        , _all( all_ )
-        , _set( 0 )
-        {}
+    Style( short all_ ) SAL_THROW(())
+        : _backgroundColor(0)
+        , _textColor(0)
+        , _textLineColor(0)
+        , _border(0)
+        , _borderColor(0)
+        , _fontRelief(css::awt::FontRelief::NONE)
+        , _fontEmphasisMark(css::awt::FontEmphasisMark::NONE)
+        , _fillColor(0)
+        , _visualEffect(0)
+        , _all(all_)
+        , _set(0)
+    {
+    }
 
     css::uno::Reference< css::xml::sax::XAttributeList > createElement();
 };
commit 1287c3cd6e961bb9503aaf5becf4f515bf3ab17e
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 21 10:40:04 2014 +0000

    coverity#708730 Uninitialized scalar field
    
    Change-Id: I464774697703b7143c3a6b0df88aa32745824394

diff --git a/xmlscript/source/xmldlg_imexp/imp_share.hxx b/xmlscript/source/xmldlg_imexp/imp_share.hxx
index 79768a0..c1b7752 100644
--- a/xmlscript/source/xmldlg_imexp/imp_share.hxx
+++ b/xmlscript/source/xmldlg_imexp/imp_share.hxx
@@ -307,18 +307,26 @@ public:
     bool importVisualEffectStyle(
         css::uno::Reference< css::beans::XPropertySet > const & xProps );
 
-    inline StyleElement(
+    StyleElement(
         OUString const & rLocalName,
         css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
         ElementBase * pParent, DialogImport * pImport )
         SAL_THROW(())
         : ElementBase( pImport->XMLNS_DIALOGS_UID,
                        rLocalName, xAttributes, pParent, pImport )
+        , _backgroundColor(0)
+        , _textColor(0)
+        , _textLineColor(0)
+        , _border(0)
+        , _borderColor(0)
         , _fontRelief( css::awt::FontRelief::NONE )
         , _fontEmphasisMark( css::awt::FontEmphasisMark::NONE )
+        , _fillColor(0)
+        , _visualEffect(0)
         , _inited( 0 )
         , _hasValue( 0 )
-        {}
+    {
+    }
 };
 
 class MenuPopupElement
commit 920560b6b01f83c40d952fff90a15c70f1357fbc
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 21 10:36:10 2014 +0000

    coverity#708732 Uninitialized scalar field
    
    Change-Id: I0e76926d25491f54b6552c5bc1d55c77e39318b0

diff --git a/xmlscript/source/xmllib_imexp/imp_share.hxx b/xmlscript/source/xmllib_imexp/imp_share.hxx
index 99c3773..b164f54 100644
--- a/xmlscript/source/xmllib_imexp/imp_share.hxx
+++ b/xmlscript/source/xmllib_imexp/imp_share.hxx
@@ -125,10 +125,14 @@ public:
     }
 
     // Single library mode
-    inline LibraryImport( LibDescriptor* pLibDesc )
-        SAL_THROW(())
-        : mpLibArray( NULL )
-        , mpLibDesc( pLibDesc ) {}
+    LibraryImport(LibDescriptor* pLibDesc) SAL_THROW(())
+        : mpLibArray(NULL)
+        , mpLibDesc(pLibDesc)
+        , XMLNS_LIBRARY_UID(0)
+        , XMLNS_XLINK_UID(0)
+    {
+    }
+
     virtual ~LibraryImport()
         SAL_THROW(());
 
commit 297183a9e4c5a219093d712f07ae1600e37a246e
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 21 10:34:45 2014 +0000

    coverity#708733 Uninitialized scalar field
    
    Change-Id: I751be405978cfc4c13047033a71504353439145d

diff --git a/xmlscript/source/xmllib_imexp/imp_share.hxx b/xmlscript/source/xmllib_imexp/imp_share.hxx
index fc41ae7..99c3773 100644
--- a/xmlscript/source/xmllib_imexp/imp_share.hxx
+++ b/xmlscript/source/xmllib_imexp/imp_share.hxx
@@ -116,10 +116,14 @@ struct LibraryImport
     sal_Int32 XMLNS_XLINK_UID;
 
 public:
-    inline LibraryImport( LibDescriptorArray* pLibArray )
-        SAL_THROW(())
-        : mpLibArray( pLibArray )
-        , mpLibDesc( NULL ) {}
+    LibraryImport( LibDescriptorArray* pLibArray ) SAL_THROW(())
+        : mpLibArray(pLibArray)
+        , mpLibDesc(NULL)
+        , XMLNS_LIBRARY_UID(0)
+        , XMLNS_XLINK_UID(0)
+    {
+    }
+
     // Single library mode
     inline LibraryImport( LibDescriptor* pLibDesc )
         SAL_THROW(())
commit 625b27631144d881fca32b55648fbfd8099e9a64
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 21 10:33:09 2014 +0000

    coverity#708734 Uninitialized scalar field
    
    Change-Id: Icea7902268a362f35c16a22597f2c55d67eaa83e

diff --git a/xmlscript/source/xmlmod_imexp/imp_share.hxx b/xmlscript/source/xmlmod_imexp/imp_share.hxx
index 1ed5ff7..b991c82 100644
--- a/xmlscript/source/xmlmod_imexp/imp_share.hxx
+++ b/xmlscript/source/xmlmod_imexp/imp_share.hxx
@@ -55,11 +55,15 @@ struct ModuleImport
     sal_Int32 XMLNS_XLINK_UID;
 
 public:
-    inline ModuleImport( ModuleDescriptor& rModuleDesc )
-        SAL_THROW(())
-        : mrModuleDesc( rModuleDesc ) {}
-    virtual ~ModuleImport()
-        SAL_THROW(());
+    ModuleImport(ModuleDescriptor& rModuleDesc) SAL_THROW(())
+        : mrModuleDesc(rModuleDesc)
+        , XMLNS_SCRIPT_UID(0)
+        , XMLNS_LIBRARY_UID(0)
+        , XMLNS_XLINK_UID(0)
+    {
+    }
+
+    virtual ~ModuleImport() SAL_THROW(());
 
     // XRoot
     virtual void SAL_CALL startDocument(
commit cbfc354088d391f28f7913c73bd0745d521dc1ea
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 21 10:30:51 2014 +0000

    coverity#708739 Uninitialized scalar field
    
    Change-Id: I2ac9aa4d74321c9d4312650e744ce54c4af553bb

diff --git a/xmlsecurity/source/helper/xsecctl.cxx b/xmlsecurity/source/helper/xsecctl.cxx
index 8cc87f9..369e6dc 100644
--- a/xmlsecurity/source/helper/xsecctl.cxx
+++ b/xmlsecurity/source/helper/xsecctl.cxx
@@ -46,13 +46,18 @@ namespace cssxw = com::sun::star::xml::wrapper;
 #define SAXEVENTKEEPER_COMPONENT "com.sun.star.xml.crypto.sax.SAXEventKeeper"
 
 XSecController::XSecController( const cssu::Reference<cssu::XComponentContext>& rxCtx )
-    :mxCtx(rxCtx),
-     m_nNextSecurityId(1),
-      m_bIsSAXEventKeeperConnected(false),
-     m_nStatusOfSecurityComponents(UNINITIALIZED),
-      m_bIsSAXEventKeeperSticky(false),
-     m_pErrorMessage(NULL),
-     m_pXSecParser(NULL)
+    : mxCtx(rxCtx)
+    , m_nNextSecurityId(1)
+    , m_bIsPreviousNodeInitializable(false)
+    , m_bIsSAXEventKeeperConnected(false)
+    , m_bIsCollectingElement(false)
+    , m_bIsBlocking(false)
+    , m_nStatusOfSecurityComponents(UNINITIALIZED)
+    , m_bIsSAXEventKeeperSticky(false)
+    , m_pErrorMessage(NULL)
+    , m_pXSecParser(NULL)
+    , m_nReservedSignatureId(0)
+    , m_bVerifyCurrentSignature(false)
 {
 }
 
commit 108c5bb958a64763be1eb340af0fb5610f6274d3
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 21 10:27:51 2014 +0000

    coverity#708740 Uninitialized scalar field
    
    Change-Id: Ic3cb17f2344192a3e9704ff7e1d825e62dc45d19

diff --git a/xmlsecurity/source/helper/xsecparser.cxx b/xmlsecurity/source/helper/xsecparser.cxx
index 1d807ac..b663975 100644
--- a/xmlsecurity/source/helper/xsecparser.cxx
+++ b/xmlsecurity/source/helper/xsecparser.cxx
@@ -27,12 +27,17 @@
 namespace cssu = com::sun::star::uno;
 namespace cssxs = com::sun::star::xml::sax;
 
-XSecParser::XSecParser(
-    XSecController* pXSecController,
-    const cssu::Reference< cssxs::XDocumentHandler >& xNextHandler )
-    : m_pXSecController(pXSecController),
-      m_xNextHandler(xNextHandler),
-      m_bReferenceUnresolved(false)
+XSecParser::XSecParser(XSecController* pXSecController,
+    const cssu::Reference< cssxs::XDocumentHandler >& xNextHandler)
+    : m_bInX509IssuerName(false)
+    , m_bInX509SerialNumber(false)
+    , m_bInX509Certificate(false)
+    , m_bInDigestValue(false)
+    , m_bInSignatureValue(false)
+    , m_bInDate(false)
+    , m_pXSecController(pXSecController)
+    , m_xNextHandler(xNextHandler)
+    , m_bReferenceUnresolved(false)
 {
 }
 


More information about the Libreoffice-commits mailing list