diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2022-04-26 15:08:36 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2022-04-26 17:04:01 +0200 |
commit | bdff0bb77b57def835fcaed3bded7519e69dc896 (patch) | |
tree | c330add464f566a32ebd82dd9ad29f91ba0d87f8 /ucbhelper | |
parent | 651527b4efe9700c8c8dff58ce5aa86ad5681f16 (diff) |
Use o3tl::make_unsigned in some places
...where a signed and an unsigned value are compared, and the signed value has
just been proven to be non-negative here
Change-Id: I9665e6c2c4c5557f2d4cf1bb646f9fffc7bd7d30
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133442
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'ucbhelper')
-rw-r--r-- | ucbhelper/source/provider/propertyvalueset.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ucbhelper/source/provider/propertyvalueset.cxx b/ucbhelper/source/provider/propertyvalueset.cxx index f2601dcb6bd7..a6a7312c284c 100644 --- a/ucbhelper/source/provider/propertyvalueset.cxx +++ b/ucbhelper/source/provider/propertyvalueset.cxx @@ -34,6 +34,7 @@ #include <osl/diagnose.h> #include <ucbhelper/propertyvalueset.hxx> +#include <o3tl/safeint.hxx> #include <o3tl/typed_flags_set.hxx> using namespace com::sun::star::beans; @@ -161,7 +162,7 @@ T PropertyValueSet::getValue(PropsSet nTypeName, sal_Int32 columnIndex) m_bWasNull = true; - if ( ( columnIndex < 1 ) || ( columnIndex > sal_Int32( m_pValues->size() ) ) ) + if ( ( columnIndex < 1 ) || ( o3tl::make_unsigned(columnIndex) > m_pValues->size() ) ) { OSL_FAIL( "PropertyValueSet - index out of range!" ); return aValue; @@ -356,7 +357,7 @@ Any SAL_CALL PropertyValueSet::getObject( m_bWasNull = true; if ( ( columnIndex < 1 ) - || ( columnIndex > sal_Int32( m_pValues->size() ) ) ) + || ( o3tl::make_unsigned(columnIndex) > m_pValues->size() ) ) { OSL_FAIL( "PropertyValueSet - index out of range!" ); } |