[Libreoffice-commits] core.git: 2 commits - sw/source

Caolán McNamara caolanm at redhat.com
Fri Mar 28 06:56:25 PDT 2014


 sw/source/core/frmedt/feshview.cxx  |    5 +++--
 sw/source/core/table/swnewtable.cxx |    6 ++++++
 2 files changed, 9 insertions(+), 2 deletions(-)

New commits:
commit 70245edb948c7f084f8490ed1e7f79f3962b4322
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 28 13:28:47 2014 +0000

    coverity#705106 Integer overflowed argument
    
    Change-Id: I843b02cb8d215c149aa646441f3c7b0ab5550906

diff --git a/sw/source/core/table/swnewtable.cxx b/sw/source/core/table/swnewtable.cxx
index b74132f..cbbda80 100644
--- a/sw/source/core/table/swnewtable.cxx
+++ b/sw/source/core/table/swnewtable.cxx
@@ -1325,6 +1325,12 @@ static sal_uInt16 lcl_CalculateSplitLineHeights( SwSplitLines &rCurr, SwSplitLin
 
     if( aBoxes.empty() )
         return 0;
+
+    //coverity#705106, help coverity out here
+    assert(nFirst != USHRT_MAX);
+    if (nFirst == USHRT_MAX)
+        return 0;
+
     SwTwips nHeight = 0;
     SwTwips* pLines = new SwTwips[ nLast + 1 - nFirst ];
     for( sal_uInt16 i = nFirst; i <= nLast; ++i )
commit 29f1b19679de9852c64196e495a33a0cdd210f94
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 28 13:14:58 2014 +0000

    coverity#1078669 Failure to restore non-local value
    
    Change-Id: I3817295a39e409cf5a9ab72b9b24d7b859f5a186

diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
index 5cc02c1..c7fabef 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -2673,6 +2673,7 @@ int SwFEShell::Chainable( SwRect &rRect, const SwFrmFmt &rSource,
     if ( rChain.GetNext() )
         return SW_CHAIN_SOURCE_CHAINED;
 
+    int nRet = SW_CHAIN_NOT_FOUND;
     if( Imp()->HasDrawView() )
     {
         SdrObject* pObj;
@@ -2689,11 +2690,11 @@ int SwFEShell::Chainable( SwRect &rRect, const SwFrmFmt &rSource,
             // Target and source should not be equal and the list
             // should not be cyclic
             SwFrmFmt *pFmt = pFly->GetFmt();
-            return GetDoc()->Chainable(rSource, *pFmt);
+            nRet = GetDoc()->Chainable(rSource, *pFmt);
         }
         pDView->SetHitTolerancePixel( nOld );
     }
-    return SW_CHAIN_NOT_FOUND;
+    return nRet;
 }
 
 int SwFEShell::Chain( SwFrmFmt &rSource, const SwFrmFmt &rDest )


More information about the Libreoffice-commits mailing list