sc/source/core/tool/appoptio.cxx |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit ddcca37dbf96bf05912c4ab30b43702138896677
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Fri Jul 12 19:17:47 2024 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Fri Jul 12 22:41:31 2024 +0200

    cid#1607312 silence Overflowed integer argument
    
    Change-Id: I5de8e5756bbbe1d47d9dd40c2d49122ef8e7f15b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170418
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Tested-by: Jenkins

diff --git a/sc/source/core/tool/appoptio.cxx b/sc/source/core/tool/appoptio.cxx
index 7b44ca39fe4f..0115be53db76 100644
--- a/sc/source/core/tool/appoptio.cxx
+++ b/sc/source/core/tool/appoptio.cxx
@@ -355,11 +355,12 @@ void ScAppCfg::ReadInputCfg()
         sal_Int32 nCount = aSeq.getLength();
         if (nCount < SAL_MAX_UINT16)
         {
-            std::vector<sal_uInt16> pUShorts(nCount);
-            for (sal_Int32 i = 0; i < nCount; i++)
+            sal_uInt16 nLRUCount = nCount;
+            std::vector<sal_uInt16> pUShorts(nLRUCount);
+            for (sal_uInt16 i = 0; i < nLRUCount; ++i)
                 pUShorts[i] = aSeq[i];
 
-            SetLRUFuncList(pUShorts.data(), nCount);
+            SetLRUFuncList(pUShorts.data(), nLRUCount);
         }
     }
     
SetAutoComplete(ScUnoHelpFunctions::GetBoolFromAny(aValues[SCINPUTOPT_AUTOINPUT]));

Reply via email to