summaryrefslogtreecommitdiff
path: root/sc/inc/address.hxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-11-17 20:40:12 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-11-18 09:08:18 +0000
commit8921054fe8b819ef52d0e0b6aee84314677e90f2 (patch)
tree3601aa4dd04e2634a9687b8c85165cdebb05b7d8 /sc/inc/address.hxx
parent206d68d587ee106c1a51db8507268fdf21fa1ddc (diff)
Related: coverity#1242793 Untrusted value as argument
why doesn't coverity consider that Valid[Tab|Row|Col] check the lower bound of nPos. Could it need to be as simple as naively looking for a ">=" Change-Id: Id80f9d30b9166caef20b74569f7b50a569189d71
Diffstat (limited to 'sc/inc/address.hxx')
-rw-r--r--sc/inc/address.hxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/sc/inc/address.hxx b/sc/inc/address.hxx
index 7fcdee159da9..07ebe02c2537 100644
--- a/sc/inc/address.hxx
+++ b/sc/inc/address.hxx
@@ -110,22 +110,22 @@ const SCROW W16MAXROW = W16MAXROWCOUNT - 1;
// old stuff defines end
inline bool ValidCol( SCCOL nCol )
{
- return static_cast<SCCOL>(0) <= nCol && nCol <= MAXCOL;
+ return nCol >= static_cast<SCCOL>(0) && nCol <= MAXCOL;
}
inline bool ValidRow( SCROW nRow )
{
- return static_cast<SCROW>(0) <= nRow && nRow <= MAXROW;
+ return nRow >= static_cast<SCROW>(0) && nRow <= MAXROW;
}
inline bool ValidTab( SCTAB nTab )
{
- return static_cast<SCTAB>(0) <= nTab && nTab <= MAXTAB;
+ return nTab >= static_cast<SCTAB>(0) && nTab <= MAXTAB;
}
inline bool ValidTab( SCTAB nTab, SCTAB nMaxTab )
{
- return static_cast<SCTAB>(0) <= nTab && nTab <= nMaxTab;
+ return nTab >= static_cast<SCTAB>(0) && nTab <= nMaxTab;
}
inline bool ValidColRow( SCCOL nCol, SCROW nRow )