From 36133d203baa93e0ac34f92543e6403489ee1378 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 24 Aug 2019 20:51:33 +0100 Subject: cid#1242793 Untrusted value as argument MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Tested-by: Caolán McNamara --- sc/inc/address.hxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sc') 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: -- cgit b/libreoffice-5-2 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
path: root/tools/qa