[Libreoffice-commits] core.git: 10 commits - connectivity/source filter/source include/oox sc/source sd/source sw/source writerperfect/qa

Caolán McNamara caolanm at redhat.com
Thu Sep 5 05:24:21 PDT 2013


 connectivity/source/drivers/firebird/Connection.hxx     |    2 -
 connectivity/source/drivers/jdbc/ContextClassLoader.cxx |    1 
 filter/source/msfilter/svdfppt.cxx                      |   12 +++----
 include/oox/crypto/CryptTools.hxx                       |    3 +
 sc/source/ui/cctrl/checklistmenu.cxx                    |    2 -
 sd/source/ui/inc/unmodpg.hxx                            |    8 ++---
 sd/source/ui/view/unmodpg.cxx                           |    5 +++
 sw/source/core/txtnode/swfont.cxx                       |   12 +++++++
 sw/source/filter/ww8/docxattributeoutput.cxx            |   25 ++++++++++++----
 sw/source/ui/utlui/prcntfld.cxx                         |    7 +++-
 writerperfect/qa/unit/WPXSvStreamTest.cxx               |    1 
 11 files changed, 57 insertions(+), 21 deletions(-)

New commits:
commit a46fade2c1c7ea29ff7553d5d10afbf813839af1
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Sep 5 12:57:59 2013 +0100

    CID#1078757 nOfs <= nPersistPtrAnz
    
    Change-Id: Icf2729a4a7f8476d71d4609e060d3da2d172e7a8

diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index 41307b7..f8a0f42 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -1319,13 +1319,13 @@ SdrPowerPointImport::SdrPowerPointImport( PowerPointImportParam& rParam, const O
             bOk = sal_False;                                // (it should not be greater than the PPT_PST_PersistPtrIncrementalBlock, but
                                                         // we are reading this block later, so we do not have access yet)
 
-        if ( bOk && ( nPersistPtrAnz < ( SAL_MAX_UINT32 / sizeof( sal_uInt32 ) ) ) )
-            pPersistPtr = new (std::nothrow) sal_uInt32[ nPersistPtrAnz ];
+        if ( bOk && ( nPersistPtrAnz < ( SAL_MAX_UINT32 / sizeof( sal_uInt32 ) ) -1 ) )
+            pPersistPtr = new (std::nothrow) sal_uInt32[ nPersistPtrAnz + 1 ];
         if ( !pPersistPtr )
             bOk = sal_False;
         if ( bOk )
         {
-            memset( pPersistPtr, 0x00, nPersistPtrAnz * 4 );
+            memset( pPersistPtr, 0x00, (nPersistPtrAnz+1) * sizeof(sal_uInt32) );
 
             // SJ: new search mechanism from bottom to top (Issue 21122)
             PptUserEditAtom aCurrentEditAtom( aUserEditAtom );
@@ -1343,14 +1343,14 @@ SdrPowerPointImport::SdrPowerPointImport( PowerPointImportParam& rParam, const O
                         sal_uLong nPibLen = aPersistHd.GetRecEndFilePos();
                         while ( bOk && ( rStCtrl.GetError() == 0 ) && ( rStCtrl.Tell() < nPibLen ) )
                         {
-                            sal_uInt32 nOfs, nAnz;
+                            sal_uInt32 nOfs(0);
                             rStCtrl >> nOfs;
-                            nAnz = nOfs;
+                            sal_uInt32 nAnz = nOfs;
                             nOfs &= 0x000FFFFF;
                             nAnz >>= 20;
                             while ( bOk && ( rStCtrl.GetError() == 0 ) && ( nAnz > 0 ) && ( nOfs <= nPersistPtrAnz ) )
                             {
-                                sal_uInt32 nPt;
+                                sal_uInt32 nPt(0);
                                 rStCtrl >> nPt;
                                 if ( !pPersistPtr[ nOfs ] )
                                 {
commit 83d62cad9398eb3973e3007a43ad49ed345ee176
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Sep 5 12:43:10 2013 +0100

    CID#1079186 ununinitialized pointer
    
    Change-Id: Ie22e82904dc12f064c3b7d47bce294c5515590de

diff --git a/connectivity/source/drivers/jdbc/ContextClassLoader.cxx b/connectivity/source/drivers/jdbc/ContextClassLoader.cxx
index ec22374..544fdbc 100644
--- a/connectivity/source/drivers/jdbc/ContextClassLoader.cxx
+++ b/connectivity/source/drivers/jdbc/ContextClassLoader.cxx
@@ -39,6 +39,7 @@ namespace connectivity { namespace jdbc
         :m_environment( environment )
         ,m_currentThread( environment )
         ,m_oldContextClassLoader( environment )
+        ,m_setContextClassLoaderMethod( NULL )
     {
         if ( !newClassLoader.is() )
             return;
commit 048598504cff3a68334e521f4a3bf15d0134557c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Sep 5 12:34:40 2013 +0100

    CID#1079327 uninitialized scalar values
    
    Change-Id: I62d58154ca8c5b4c6b6b0d1aece1b5ecbab2a6eb

diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx
index a0e3393a..e684fc3 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -865,7 +865,7 @@ ScCheckListMenuWindow::Config::Config() :
 }
 
 ScCheckListMenuWindow::Member::Member() :
-    mbVisible(true)
+    mbVisible(true), mbDate(false), mbLeaf(false)
 {
 }
 
commit 8430357c7fbb2aa7fd0010a5451c4bc007f06612
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Sep 5 12:30:38 2013 +0100

    CID#1079343 mContext.cipher is not initialized...
    
    use protected to indicate that this is not callable directly, but only by
    another ctor which will do the initialization. Not sure if coverity will grok
    that, but if it doesn't then it can be submitted as a false positive
    
    Change-Id: I8e97c0b441dc407a005913e2b10f0fb48f45672b

diff --git a/include/oox/crypto/CryptTools.hxx b/include/oox/crypto/CryptTools.hxx
index 3c9bf0b..07abc71 100644
--- a/include/oox/crypto/CryptTools.hxx
+++ b/include/oox/crypto/CryptTools.hxx
@@ -72,9 +72,10 @@ protected:
             CK_ATTRIBUTE_TYPE operation);
 #endif
 
-public:
+protected:
     Crypto(CryptoType type);
 
+public:
     virtual ~Crypto();
 
     virtual sal_uInt32 update(
commit 779aa2077d3f25cf19f74acd69e1f6d819b4610c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Sep 5 12:25:04 2013 +0100

    CID#1079393 Wrapper object use after free
    
    If coverity is taking exceptions into account its right, if its not
    then its a false positive. Lets do the save and restore on scope
    to find out.
    
    Change-Id: I007f86d701e193c2e097a186119c1d0b367cbb97

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 7f08f58..b7c528a 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -289,6 +289,23 @@ void lcl_TextFrameShadow(FSHelperPtr pSerializer, const SwFrmFmt& rFrmFmt)
             FSEND);
 }
 
+class ExportDataSaveRestore
+{
+private:
+    DocxExport& m_rExport;
+public:
+    ExportDataSaveRestore(DocxExport& rExport, sal_uLong nStt, sal_uLong nEnd, sw::Frame *pParentFrame)
+        : m_rExport(rExport)
+    {
+        m_rExport.SaveData(nStt, nEnd);
+        m_rExport.mpParentFrame = pParentFrame;
+    }
+    ~ExportDataSaveRestore()
+    {
+        m_rExport.RestoreData();
+    }
+};
+
 void DocxAttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner )
 {
     // write the paragraph properties + the run, already in the correct order
@@ -309,9 +326,8 @@ void DocxAttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pT
         sal_uLong nStt = pNodeIndex ? pNodeIndex->GetIndex()+1                  : 0;
         sal_uLong nEnd = pNodeIndex ? pNodeIndex->GetNode().EndOfSectionIndex() : 0;
 
-        m_rExport.SaveData( nStt, nEnd );
-
-        m_rExport.mpParentFrame = pParentFrame;
+        //Save data here and restore when out of scope
+        ExportDataSaveRestore aDataGuard(m_rExport, nStt, nEnd, pParentFrame);
 
         // When a frame has some low height, but automatically expanded due
         // to lots of contents, this size contains the real size.
@@ -358,9 +374,6 @@ void DocxAttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pT
         m_pSerializer->endElementNS( XML_v, XML_rect );
         m_pSerializer->endElementNS( XML_w, XML_pict );
         m_pSerializer->endElementNS( XML_w, XML_r );
-
-        m_rExport.RestoreData();
-
     }
 
     m_pSerializer->endElementNS( XML_w, XML_p );
commit 452584805c0356f335563ce9dc8c021be5ded9b7
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Sep 5 12:09:59 2013 +0100

    CID#1079332 Uninitialized scalar field
    
    Change-Id: I07239ddec7806261fa9098839fd3fc9e5c400594

diff --git a/connectivity/source/drivers/firebird/Connection.hxx b/connectivity/source/drivers/firebird/Connection.hxx
index ca6fae6..4d7658d 100644
--- a/connectivity/source/drivers/firebird/Connection.hxx
+++ b/connectivity/source/drivers/firebird/Connection.hxx
@@ -75,7 +75,6 @@ namespace connectivity
                                             { return m_aMutex; }
         protected:
             static const OUString sDBLocation; // Location within .odb container
-            rtl_TextEncoding                        m_nTextEncoding; // the encoding which is used for all text conversions
             //====================================================================
             // Data attributes
             //====================================================================
@@ -166,7 +165,6 @@ namespace connectivity
             inline ::rtl::OUString  getUserName()       const { return m_sUser; }
             inline isc_db_handle&    getDBHandle()       { return m_DBHandler; }
             inline FirebirdDriver*  getDriver()         const { return m_pDriver;}
-            inline rtl_TextEncoding getTextEncoding()   const { return m_nTextEncoding; }
 
             ::rtl::OUString         getConnectionURL()  const { return m_sConnectionURL; }
             sal_Bool                isEmbedded()        const { return m_bIsEmbedded; }
commit 87d26811113f0188397a8b97a9b59bc2af3e4091
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Sep 5 12:06:50 2013 +0100

    CID#1079333 Uninitialized scalar field
    
    Change-Id: I98accfecd5922d6882dfe97c8c72fff3afa5392c

diff --git a/sw/source/ui/utlui/prcntfld.cxx b/sw/source/ui/utlui/prcntfld.cxx
index e2f217b..6f54165 100644
--- a/sw/source/ui/utlui/prcntfld.cxx
+++ b/sw/source/ui/utlui/prcntfld.cxx
@@ -21,10 +21,15 @@
 #include "prcntfld.hxx"
 
 PercentField::PercentField()
-    : nOldMax(0)
+    : m_pField(NULL)
+    , nRefValue(0)
+    , nOldMax(0)
     , nOldMin(0)
+    , nOldSpinSize(0)
+    , nOldBaseValue(0)
     , nLastPercent(-1)
     , nLastValue(-1)
+    , nOldDigits(0)
     , eOldUnit(FUNIT_NONE)
     , bLockAutoCalculation(sal_False)
 {
commit d13e7ae4673d2252d9ac74238a2e8ad7a6a045af
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Sep 5 12:04:50 2013 +0100

    CID#1079335 Uninitialized scalar field
    
    Change-Id: If918af4352c54cf92dbb45bb9a689ca2e7a8a863

diff --git a/sd/source/ui/inc/unmodpg.hxx b/sd/source/ui/inc/unmodpg.hxx
index bd48758..3b389bc 100644
--- a/sd/source/ui/inc/unmodpg.hxx
+++ b/sd/source/ui/inc/unmodpg.hxx
@@ -33,10 +33,10 @@ class ModifyPageUndoAction : public SdUndoAction
     OUString        maNewName;
     AutoLayout      meOldAutoLayout;
     AutoLayout      meNewAutoLayout;
-    sal_Bool            mbOldBckgrndVisible;
-    sal_Bool            mbNewBckgrndVisible;
-    sal_Bool            mbOldBckgrndObjsVisible;
-    sal_Bool            mbNewBckgrndObjsVisible;
+    sal_Bool        mbOldBckgrndVisible;
+    sal_Bool        mbNewBckgrndVisible;
+    sal_Bool        mbOldBckgrndObjsVisible;
+    sal_Bool        mbNewBckgrndObjsVisible;
 
     OUString        maComment;
 
diff --git a/sd/source/ui/view/unmodpg.cxx b/sd/source/ui/view/unmodpg.cxx
index 7ff176a..580c71c 100644
--- a/sd/source/ui/view/unmodpg.cxx
+++ b/sd/source/ui/view/unmodpg.cxx
@@ -70,6 +70,11 @@ ModifyPageUndoAction::ModifyPageUndoAction(
         mbOldBckgrndVisible = aVisibleLayers.IsSet(aBckgrnd);
         mbOldBckgrndObjsVisible = aVisibleLayers.IsSet(aBckgrndObj);
     }
+    else
+    {
+        mbOldBckgrndVisible = false;
+        mbOldBckgrndObjsVisible = false;
+    }
 
     maComment = SD_RESSTR(STR_UNDO_MODIFY_PAGE);
 }
commit b5dddbbb41f7c4c7d9b89caaec296f0133589e5b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Sep 5 11:56:24 2013 +0100

    CID#1079350 Uninitialized scalar field
    
    Change-Id: I0a3bbb5a962b33aad1c9ef2c5fa751ec15d79dc9

diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx
index 6f08a45..be6a52e 100644
--- a/sw/source/core/txtnode/swfont.cxx
+++ b/sw/source/core/txtnode/swfont.cxx
@@ -714,7 +714,19 @@ SwFont::SwFont()
     , m_aShadowColor(COL_TRANSPARENT)
     , m_nShadowWidth(0)
     , m_aShadowLocation(SVX_SHADOW_NONE)
+    , nToxCnt(0)
+    , nRefCnt(0)
+    , m_nMetaCount(0)
     , nActual(SW_LATIN)
+    , bNoHyph(false)
+    , bBlink(false)
+    , bPaintBlank(false)
+    , bFntChg(false)
+    , bOrgChg(false)
+    , bURL(false)
+    , bPaintWrong(false)
+    , bGreyWave(false)
+    , bNoColReplace(false)
 {
 }
 
commit e04f1a6fcea01872ac7d7e4a2843dcb8f47dfcd9
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Sep 5 11:54:32 2013 +0100

    CID#1079361 unused pointer value
    
    Change-Id: I00e7370792e2971b3f00ac8ec0ea0df4426613a9

diff --git a/writerperfect/qa/unit/WPXSvStreamTest.cxx b/writerperfect/qa/unit/WPXSvStreamTest.cxx
index 1dc6527..fb11e4e 100644
--- a/writerperfect/qa/unit/WPXSvStreamTest.cxx
+++ b/writerperfect/qa/unit/WPXSvStreamTest.cxx
@@ -129,6 +129,7 @@ void WPXSvStreamTest::testRead()
     pData = pInput->read(0UL, nReadBytes);
     CPPUNIT_ASSERT_EQUAL(0UL, nReadBytes);
     CPPUNIT_ASSERT_EQUAL(0L, pInput->tell());
+    CPPUNIT_ASSERT_EQUAL(pData, static_cast<const unsigned char*>(0));
     CPPUNIT_ASSERT(!pInput->atEOS());
 }
 


More information about the Libreoffice-commits mailing list