[Libreoffice-commits] core.git: sc/inc

Caolán McNamara caolanm at redhat.com
Wed Dec 3 08:52:45 PST 2014


 sc/inc/table.hxx |    9 +++++++++
 1 file changed, 9 insertions(+)

New commits:
commit 093b3d30f257a01122042eb4d116ee54fbdb7033
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Dec 3 15:43:21 2014 +0000

    coverity#1242942 Use of untrusted scalar value
    
    see can we make this somewhat more obvious to coverity
    
    Change-Id: I2a3d9259f36c45b74391ecb5d96bf168959eb268

diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index c7898f1..318805a 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -1163,6 +1163,15 @@ private:
         SCROW mnUBound;
     };
 
+    bool ValidCol(SCCOL nCol) const
+    {
+        return nCol >= 0 && static_cast<size_t>(nCol) < SAL_N_ELEMENTS(aCol);
+    }
+
+    bool ValidColRow(SCCOL nCol, SCROW nRow) const
+    {
+        return ValidCol(nCol) && ValidRow(nRow);
+    }
 };
 
 #endif


More information about the Libreoffice-commits mailing list