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 /package | |
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 'package')
-rw-r--r-- | package/source/zipapi/ZipFile.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/package/source/zipapi/ZipFile.cxx b/package/source/zipapi/ZipFile.cxx index dba57c1f200c..98f60bd4ab1d 100644 --- a/package/source/zipapi/ZipFile.cxx +++ b/package/source/zipapi/ZipFile.cxx @@ -35,6 +35,7 @@ #include <comphelper/processfactory.hxx> #include <rtl/digest.h> #include <sal/log.hxx> +#include <o3tl/safeint.hxx> #include <osl/diagnose.h> #include <algorithm> @@ -618,7 +619,7 @@ public: // XSeekable virtual void SAL_CALL seek( sal_Int64 location ) override { - if ( location > sal_Int64(maBytes.size()) || location < 0 ) + if ( location < 0 || o3tl::make_unsigned(location) > maBytes.size() ) throw IllegalArgumentException(THROW_WHERE, uno::Reference< uno::XInterface >(), 1 ); mnPos = location; } |