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

Norbert Thiebaud nthiebaud at gmail.com
Tue Jul 1 07:20:31 PDT 2014


 hwpfilter/source/hgzip.cxx     |   14 +++++++-------
 sc/source/ui/view/viewfun2.cxx |   22 +++++++++++-----------
 2 files changed, 18 insertions(+), 18 deletions(-)

New commits:
commit b382f5df849b7ceb22aa0fba73287f040478dc13
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Tue Jul 1 16:18:48 2014 +0200

    coverity#705845 Dereference before null
    
    Change-Id: I4aecc132ca45abd45183455c87be4c4a3749d983

diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index 8404452..4bfb038 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -1707,19 +1707,19 @@ void ScViewFunc::Solve( const ScSolveParam& rParam )
 {
     ScDocument* pDoc = GetViewData().GetDocument();
 
-    SCCOL nDestCol = rParam.aRefVariableCell.Col();
-    SCROW nDestRow = rParam.aRefVariableCell.Row();
-    SCTAB nDestTab = rParam.aRefVariableCell.Tab();
-
-    ScEditableTester aTester( pDoc, nDestTab, nDestCol,nDestRow, nDestCol,nDestRow );
-    if (!aTester.IsEditable())
-    {
-        ErrorMessage(aTester.GetMessageId());
-        return;
-    }
-
     if ( pDoc )
     {
+        SCCOL nDestCol = rParam.aRefVariableCell.Col();
+        SCROW nDestRow = rParam.aRefVariableCell.Row();
+        SCTAB nDestTab = rParam.aRefVariableCell.Tab();
+
+        ScEditableTester aTester( pDoc, nDestTab, nDestCol,nDestRow, nDestCol,nDestRow );
+        if (!aTester.IsEditable())
+        {
+            ErrorMessage(aTester.GetMessageId());
+            return;
+        }
+
         OUString  aTargetValStr;
         if ( rParam.pStrTargetVal != NULL )
             aTargetValStr = *(rParam.pStrTargetVal);
commit 31050012a4010f44f8cf4698824f6f806ed1f3b2
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Tue Jul 1 16:10:11 2014 +0200

    coverity#1202814 Overflowed return value
    
    Change-Id: Ifc07a0b3f09dc1209e434056eb007a4401a09d3e

diff --git a/hwpfilter/source/hgzip.cxx b/hwpfilter/source/hgzip.cxx
index 20f40d2..6b7e0b9 100644
--- a/hwpfilter/source/hgzip.cxx
+++ b/hwpfilter/source/hgzip.cxx
@@ -284,15 +284,15 @@ int gz_flush(gz_stream * file, int flush)
 */
 local uLong getLong(gz_stream * s)
 {
-    uLong x = (uLong) get_byte(s);
-    int c;
+    uLong x = (unsigned char) get_byte(s);
 
-    x += ((uLong) get_byte(s)) << 8;
-    x += ((uLong) get_byte(s)) << 16;
-    c = get_byte(s);
-    if (c == EOF)
+    x += ((unsigned char) get_byte(s)) << 8;
+    x += ((unsigned char) get_byte(s)) << 16;
+    x += ((unsigned char) get_byte(s)) << 24;
+    if (s->z_eof)
+    {
         s->z_err = Z_DATA_ERROR;
-    x += ((uLong) c) << 24;
+    }
     return x;
 }
 


More information about the Libreoffice-commits mailing list