summaryrefslogtreecommitdiff
path: root/basic/source
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2022-06-01 23:35:27 +0200
committerStephan Bergmann <sbergman@redhat.com>2022-06-02 08:07:08 +0200
commitc387bc7dd1762f807128ecdbf79ec63884aa33b6 (patch)
tree33b9fa4401570c65a5639fcc81d09c91fbcf132d /basic/source
parentf3b5cb5a17a451c9e7d9b47b5e8854c5e126801f (diff)
The elements of XInvocation::invoke aOutParamIndex are non-negative
..so use o3tl::make_unsigned when comparing them against an expression of unsigned integer type, instead of casting that expression to a signed type Change-Id: I4fc0bd4447f55d5fd9bf893a4b22d6d2c2cfe3d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135280 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'basic/source')
-rw-r--r--basic/source/classes/sbunoobj.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index ad4aefb52f72..06b67ba8bd86 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -20,6 +20,7 @@
#include <sal/config.h>
#include <o3tl/any.hxx>
+#include <o3tl/safeint.hxx>
#include <utility>
#include <vcl/svapp.hxx>
#include <vcl/errcode.hxx>
@@ -1534,7 +1535,7 @@ static Any invokeAutomationMethod( const OUString& Name, Sequence< Any > const &
for( sal_uInt32 j = 0 ; j < nLen ; j++ )
{
sal_Int16 iTarget = pIndices[ j ];
- if( iTarget >= static_cast<sal_Int16>(nParamCount) )
+ if( o3tl::make_unsigned(iTarget) >= nParamCount )
break;
unoToSbxValue(pParams->Get(j + 1), pNewValues[j]);
}