[Libreoffice-commits] core.git: 7 commits - connectivity/source idlc/source sal/osl svx/source vcl/source vcl/unx

Norbert Thiebaud nthiebaud at gmail.com
Sat Jan 25 01:11:36 PST 2014


 connectivity/source/drivers/hsqldb/HTable.cxx |    2 -
 connectivity/source/drivers/mysql/YTable.cxx  |    2 -
 idlc/source/astexpression.cxx                 |    2 -
 sal/osl/unx/profile.c                         |   16 ++++++---------
 svx/source/unodraw/unopool.cxx                |    2 -
 vcl/source/edit/texteng.cxx                   |   27 +++++++++++++++-----------
 vcl/unx/gtk/window/gtksalframe.cxx            |    2 -
 7 files changed, 28 insertions(+), 25 deletions(-)

New commits:
commit 83924113beb0ebfd6abbe6f8ca44fb929da0934c
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Sat Jan 25 01:08:22 2014 -0600

    coverity#704842 Dereference after NULL check
    
    Change-Id: If74a78ffe0bcbd936448ed70b8fc796561fc7001

diff --git a/svx/source/unodraw/unopool.cxx b/svx/source/unodraw/unopool.cxx
index 438bd49..08a610c 100644
--- a/svx/source/unodraw/unopool.cxx
+++ b/svx/source/unodraw/unopool.cxx
@@ -188,7 +188,7 @@ void SvxUnoDrawPool::putAny( SfxItemPool* pPool, const comphelper::PropertyMapEn
         {
             ::std::auto_ptr<SfxPoolItem> pNewItem( pPool->GetDefaultItem( nWhich ).Clone() );
             sal_uInt8 nMemberId = pEntry->mnMemberId & (~SFX_METRIC_ITEM);
-            if( !pPool || (pPool->GetMetric(nWhich) == SFX_MAPUNIT_100TH_MM) )
+            if( pPool->GetMetric(nWhich) == SFX_MAPUNIT_100TH_MM )
                 nMemberId &= (~CONVERT_TWIPS);
 
             if( !pNewItem->PutValue( aValue, nMemberId ) )
commit 5d8bd348ec1c136ce423bc76cd06bf91d96f54e4
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Sat Jan 25 00:38:36 2014 -0600

    coverity#440841 : Dereference after NULL check
    
    Change-Id: Ifdbd256c3478161c16fff02e79608498175aa024

diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx
index 68a4200..06ed0d5 100644
--- a/vcl/source/edit/texteng.cxx
+++ b/vcl/source/edit/texteng.cxx
@@ -2442,19 +2442,24 @@ sal_Bool TextEngine::CreateLines( sal_uLong nPara )
             nDelFromLine = nLine;
             break;
         }
-        if ( !pLine && ( nIndex < pNode->GetText().getLength() )  )
+        if ( !pLine )
         {
-            pLine = new TextLine;
-            pTEParaPortion->GetLines().insert( pTEParaPortion->GetLines().begin() + ++nLine, pLine );
-        }
-        if ( pLine )
-        {
-            aSaveLine = *pLine;
-            pLine->SetStart( nIndex );
-            pLine->SetEnd( nIndex );
-            pLine->SetStartPortion( nEndPortion+1 );
-            pLine->SetEndPortion( nEndPortion+1 );
+            if ( nIndex < pNode->GetText().getLength() )
+            {
+                pLine = new TextLine;
+                pTEParaPortion->GetLines().insert( pTEParaPortion->GetLines().begin() + ++nLine, pLine );
+            }
+            else
+            {
+                break;
+            }
         }
+        aSaveLine = *pLine;
+        pLine->SetStart( nIndex );
+        pLine->SetEnd( nIndex );
+        pLine->SetStartPortion( nEndPortion+1 );
+        pLine->SetEndPortion( nEndPortion+1 );
+
     }   // while ( Index < Len )
 
     if (nDelFromLine != std::numeric_limits<size_t>::max())
commit e190c8345d8a6abb933affe1416ed85100eceb19
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Sat Jan 25 00:23:09 2014 -0600

    coverity#440824 : Dereference after NULL check
    
    Change-Id: Ie5c5c687c4a6dbe07abdf2f8ad0dfedb39c7abf0

diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx
index f2281e4..037807d 100644
--- a/vcl/unx/gtk/window/gtksalframe.cxx
+++ b/vcl/unx/gtk/window/gtksalframe.cxx
@@ -4312,7 +4312,7 @@ void GtkSalFrame::IMHandler::signalIMPreeditChanged( GtkIMContext*, gpointer im_
 
     bool bEndPreedit = (!pText || !*pText) && pThis->m_aInputEvent.mpTextAttr != NULL;
     pThis->m_aInputEvent.mnTime             = 0;
-    pThis->m_aInputEvent.maText             = OUString( pText, strlen(pText), RTL_TEXTENCODING_UTF8 );
+    pThis->m_aInputEvent.maText             = pText ? OUString( pText, strlen(pText), RTL_TEXTENCODING_UTF8 ) : OUString();
     pThis->m_aInputEvent.mnCursorPos        = nCursorPos;
     pThis->m_aInputEvent.mnCursorFlags      = 0;
     pThis->m_aInputEvent.mbOnlyCursor       = False;
commit 92864323e721b52e589e1720206b1a435f85263d
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Fri Jan 24 04:14:38 2014 -0600

    coverity#4407301 Dereference after null check
    
    Change-Id: I3cbb28a65dc75ac641cac88148e36ec3a819ffc4

diff --git a/connectivity/source/drivers/mysql/YTable.cxx b/connectivity/source/drivers/mysql/YTable.cxx
index decb437..aabd151 100644
--- a/connectivity/source/drivers/mysql/YTable.cxx
+++ b/connectivity/source/drivers/mysql/YTable.cxx
@@ -181,7 +181,7 @@ void SAL_CALL OMySQLTable::alterColumnByName( const OUString& colName, const Ref
 #endif
         );
 
-    if ( m_pColumns && !m_pColumns->hasByName(colName) )
+    if ( !m_pColumns || !m_pColumns->hasByName(colName) )
         throw NoSuchElementException(colName,*this);
 
 
commit 3de5e97e435504f7194e540228087aa57148552a
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Fri Jan 24 04:11:38 2014 -0600

    coverity#440730 Dereference after null check
    
    Change-Id: Iab8f02e3bb1e03c0ee7efdd0b47d8329d786578d

diff --git a/connectivity/source/drivers/hsqldb/HTable.cxx b/connectivity/source/drivers/hsqldb/HTable.cxx
index 79edbf5..247bbee 100644
--- a/connectivity/source/drivers/hsqldb/HTable.cxx
+++ b/connectivity/source/drivers/hsqldb/HTable.cxx
@@ -162,7 +162,7 @@ void SAL_CALL OHSQLTable::alterColumnByName( const OUString& colName, const Refe
 #endif
         );
 
-    if ( m_pColumns && !m_pColumns->hasByName(colName) )
+    if ( !m_pColumns || !m_pColumns->hasByName(colName) )
         throw NoSuchElementException(colName,*this);
 
 
commit 57f288fdcc775f044700aac98c8cf94024c4b7db
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Fri Jan 24 04:03:41 2014 -0600

    coverity#440240 Dereference after null check
    
    Change-Id: I1ca5e4d31ab203a0ddd5e98928f5046f5fffb485

diff --git a/idlc/source/astexpression.cxx b/idlc/source/astexpression.cxx
index 69b5f9f..995796e 100644
--- a/idlc/source/astexpression.cxx
+++ b/idlc/source/astexpression.cxx
@@ -1138,7 +1138,7 @@ OString AstExpression::toString()
 {
     OString exprStr;
     if ( m_combOperator == EC_symbol )
-        return *m_pSymbolicName;
+        return m_pSymbolicName ? *m_pSymbolicName : OString("<Undefined Name>");
 
     if ( m_exprValue )
     {
commit 4b1ab968716a82edfa956999336e5eb7cc8407bc
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Fri Jan 24 03:54:22 2014 -0600

    coverity#440167 Dereference after null check
    
    Change-Id: I05bb7592600ab157d7a5e9dc6280168519d7b5bd

diff --git a/sal/osl/unx/profile.c b/sal/osl/unx/profile.c
index c9aca5e..e9c5144 100644
--- a/sal/osl/unx/profile.c
+++ b/sal/osl/unx/profile.c
@@ -1501,17 +1501,15 @@ static sal_Char* addLine(osl_TProfileImpl* pProfile, const sal_Char* Line)
                 pProfile->m_Lines[idx]=0;
             }
         }
-
-        if (pProfile->m_Lines == NULL)
-        {
-            pProfile->m_NoLines  = 0;
-            pProfile->m_MaxLines = 0;
-            return (NULL);
-        }
-
+    }
+    if (pProfile->m_Lines == NULL)
+    {
+        pProfile->m_NoLines  = 0;
+        pProfile->m_MaxLines = 0;
+        return (NULL);
     }
 
-    if ( pProfile->m_Lines != 0 && pProfile->m_Lines[pProfile->m_NoLines] != 0 )
+    if ( pProfile->m_Lines[pProfile->m_NoLines] != 0 )
     {
         free(pProfile->m_Lines[pProfile->m_NoLines]);
     }


More information about the Libreoffice-commits mailing list