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

Caolán McNamara caolanm at redhat.com
Mon Aug 3 12:34:09 PDT 2015


 libreofficekit/source/gtk/tilebuffer.hxx                |   23 +++++++++++++++-
 svtools/source/contnr/foldertree.cxx                    |    5 +--
 sw/source/core/doc/DocumentContentOperationsManager.cxx |    2 -
 sw/source/core/doc/docfmt.cxx                           |    2 -
 sw/source/core/doc/docredln.cxx                         |    2 -
 sw/source/core/txtnode/thints.cxx                       |    6 ++--
 sw/source/core/undo/rolbck.cxx                          |   11 +++----
 7 files changed, 36 insertions(+), 15 deletions(-)

New commits:
commit cd47929a6d161a99fb89bc91e776895ca2054b88
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Aug 3 20:27:16 2015 +0100

    coverity#1314997 Dereference null return value
    
    Change-Id: If0c60ec2dcdf95a0aec7f0c9561142fee4cd30c4

diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx
index e98414a..153dc97 100644
--- a/sw/source/core/undo/rolbck.cxx
+++ b/sw/source/core/undo/rolbck.cxx
@@ -1340,10 +1340,8 @@ void SwRegHistory::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
             {
                 pNewHstr = new SwHistorySetAttrSet( rSet, m_nNodeIndex, m_WhichIdSet );
             }
-            else
+            else if (const SfxPoolItem* pItem = SfxItemIter( rSet ).FirstItem())
             {
-                const SfxPoolItem* pItem = SfxItemIter( rSet ).FirstItem();
-
                 if ( m_WhichIdSet.count( pItem->Which() ) )
                 {
                     pNewHstr = new SwHistorySetFormat( pItem, m_nNodeIndex );
commit 0b8d81e8b3da081ebdb1ae7fed7b20a51322f951
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Aug 3 20:25:49 2015 +0100

    coverity#1314998 Dereference null return value
    
    Change-Id: I1f36c486b404d189f2f39a525ec3fd2e1710e7af

diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx
index 2d2bced..e98414a 100644
--- a/sw/source/core/undo/rolbck.cxx
+++ b/sw/source/core/undo/rolbck.cxx
@@ -1442,13 +1442,14 @@ void SwRegHistory::_MakeSetWhichIds()
         if( pSet && pSet->Count() )
         {
             SfxItemIter aIter( *pSet );
-            sal_uInt16 nW = aIter.FirstItem()->Which();
-            while( true )
+            const SfxPoolItem* pItem = aIter.FirstItem();
+            while(pItem)
             {
+                sal_uInt16 nW = pItem->Which();
                 m_WhichIdSet.insert( nW );
                 if( aIter.IsAtEnd() )
                     break;
-                nW = aIter.NextItem()->Which();
+                pItem = aIter.NextItem();
             }
         }
     }
commit 11969c48a670c8e47ea4fa5b9d68c877fad50463
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Aug 3 20:23:42 2015 +0100

    coverity#1314999 Dereference null return value
    
    Change-Id: Ic1ede6f029e0b0f6e6bbf3a6b9e073d98454a769

diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx
index 59205c2..3da268e 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -1804,8 +1804,10 @@ bool SwTextNode::TryCharSetExpandToNum(const SfxItemSet& aCharSet)
 {
     bool bRet = false;
     SfxItemIter aIter( aCharSet );
-        const SfxPoolItem* pItem = aIter.FirstItem();
-        const sal_uInt16 nWhich = pItem->Which();
+    const SfxPoolItem* pItem = aIter.FirstItem();
+    if (!pItem)
+        return bRet;
+    const sal_uInt16 nWhich = pItem->Which();
 
     const SfxPoolItem& rInnerItem = GetAttr(nWhich,false);
 
commit 14c548c283210d0570b23acc9ffbc98d7892568b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Aug 3 20:22:03 2015 +0100

    coverity#1315000 Dereference null return value
    
    Change-Id: Iaa9f8104be6d24886e79c71484c4f2fb8c51c4bb

diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index 3f71cf9..0bc2a80 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -687,7 +687,7 @@ SwRedlineExtraData_Format::SwRedlineExtraData_Format( const SfxItemSet& rSet )
 {
     SfxItemIter aIter( rSet );
     const SfxPoolItem* pItem = aIter.FirstItem();
-    while( true )
+    while(pItem)
     {
         aWhichIds.push_back( pItem->Which() );
         if( aIter.IsAtEnd() )
commit 4706eee2f3de6547d475a69c340b2b20942fb2d8
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Aug 3 20:21:05 2015 +0100

    coverity#1315001 Dereference null return value
    
    Change-Id: I648d126f65adcf980767083fa88e4b672b422f7f

diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 4acd8e8..d438f53 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -183,7 +183,7 @@ static bool lcl_RstAttr( const SwNodePtr& rpNd, void* pArgs )
                         "<lcl_RstAttr(..)> - certain attributes are kept, but not needed. -> please inform OD" );
                 SfxItemIter aIter( *pPara->pDelSet );
                 pItem = aIter.FirstItem();
-                while( true )
+                while(pItem)
                 {
                     if ( ( pItem->Which() != RES_PAGEDESC &&
                            pItem->Which() != RES_BREAK &&
commit 74355bdab856dd9de2fe269c6faa199bf886f941
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Aug 3 20:19:37 2015 +0100

    coverity#1315002 Dereference null return value
    
    Change-Id: Ied9081449a38704382fb24c9a66aec493c60ae00

diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index 433c530..11039cd 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -1008,7 +1008,7 @@ namespace //local functions originally from docfmt.cxx
         {
             SfxItemIter aIter( rChgSet );
             const SfxPoolItem* pItem = aIter.FirstItem();
-            if (!IsInvalidItem(pItem))
+            if (pItem && !IsInvalidItem(pItem))
             {
                 const sal_uInt16 nWhich = pItem->Which();
 
commit f1a5b2869a8970ec637573d10e5c7cbb5d985902
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Aug 3 20:17:41 2015 +0100

    coverity#1315003 Dereference null return value
    
    Change-Id: I85a85e10d727e53f93d0c41c1f9896b4319919af

diff --git a/svtools/source/contnr/foldertree.cxx b/svtools/source/contnr/foldertree.cxx
index d597168..7131340 100644
--- a/svtools/source/contnr/foldertree.cxx
+++ b/svtools/source/contnr/foldertree.cxx
@@ -34,10 +34,9 @@ void FolderTree::FillTreeEntry( SvTreeListEntry* pEntry )
 {
     if( pEntry )
     {
-        while( GetChildCount( pEntry ) > 0 )
+        while (SvTreeListEntry* pChild = FirstChild(pEntry))
         {
-            SvTreeListEntry* pChild = FirstChild( pEntry );
-            GetModel()->Remove( pChild );
+            GetModel()->Remove(pChild);
         }
 
         ::std::vector< SortingData_Impl* > aContent;
commit 1bc0cd0ee0251d42a6cbe75e5d86de4366f59029
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Aug 3 20:15:18 2015 +0100

    coverity#1315075 Uninitialized pointer field
    
    Change-Id: I4e933b458ca26b2a92d4953ca6cd6220dd730cf9

diff --git a/libreofficekit/source/gtk/tilebuffer.hxx b/libreofficekit/source/gtk/tilebuffer.hxx
index dabf72f..b007243 100644
--- a/libreofficekit/source/gtk/tilebuffer.hxx
+++ b/libreofficekit/source/gtk/tilebuffer.hxx
@@ -206,7 +206,28 @@ struct LOEvent
 
     /// Constructor to instantiate an object of type `type`.
     LOEvent(int type)
-        : m_nType(type) {}
+        : m_nType(type)
+        , m_pCommand(0)
+        , m_pArguments(0)
+        , m_pPath(0)
+        , m_bEdit(false)
+        , m_nPartMode(0)
+        , m_nPart(0)
+        , m_nKeyEvent(0)
+        , m_nCharCode(0)
+        , m_nKeyCode(0)
+        , m_nPaintTileX(0)
+        , m_nPaintTileY(0)
+        , m_fPaintTileZoom(0)
+        , m_nPostMouseEventType(0)
+        , m_nPostMouseEventX(0)
+        , m_nPostMouseEventY(0)
+        , m_nPostMouseEventCount(0)
+        , m_nSetGraphicSelectionType(0)
+        , m_nSetGraphicSelectionX(0)
+        , m_nSetGraphicSelectionY(0)
+    {
+    }
 };
 
 #endif // INCLUDED_TILEBUFFER_HXX


More information about the Libreoffice-commits mailing list