diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-08-24 20:51:33 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-08-25 11:29:46 +0200 |
commit | 36133d203baa93e0ac34f92543e6403489ee1378 (patch) | |
tree | 9b11e917f892a27a3cdfee8bf3f47c1c7fd3a38a /sc/inc/address.hxx | |
parent | 2babe56a83613db6167a42a3284cf0f4f92a1b52 (diff) |
cid#1242793 Untrusted value as argument
help coverity know this is sanitizing its argument
Change-Id: I54eb64bae73ef55e7431f6764536304c298a28c9
Reviewed-on: https://gerrit.libreoffice.org/78070
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc/inc/address.hxx')
-rw-r--r-- | sc/inc/address.hxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sc/inc/address.hxx b/sc/inc/address.hxx index b7baaa4c0bc0..df26f12c1408 100644 --- a/sc/inc/address.hxx +++ b/sc/inc/address.hxx @@ -125,17 +125,17 @@ const SCROW SCROW_REPEAT_NONE = SCROW_MAX; [[nodiscard]] inline SCCOL SanitizeCol( SCCOL nCol ) { - return nCol < 0 ? 0 : std::min(nCol, MAXCOL); + return nCol < 0 ? 0 : (nCol > MAXCOL ? MAXCOL : nCol); } [[nodiscard]] inline SCROW SanitizeRow( SCROW nRow ) { - return nRow < 0 ? 0 : std::min(nRow, MAXROW); + return nRow < 0 ? 0 : (nRow > MAXROW ? MAXROW : nRow); } [[nodiscard]] inline SCTAB SanitizeTab( SCTAB nTab ) { - return nTab < 0 ? 0 : std::min(nTab, MAXTAB); + return nTab < 0 ? 0 : (nTab > MAXTAB ? MAXTAB : nTab); } // The result of ConvertRef() is a bit group of the following: |