summaryrefslogtreecommitdiff
path: root/comphelper
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2022-06-02 18:46:09 +0200
committerStephan Bergmann <sbergman@redhat.com>2022-06-02 20:37:13 +0200
commit74fe9be6fda68d331d73f4331f670d1a24964505 (patch)
tree372c758e0554fafae70fbdd6cd7d7ce4d58657c7 /comphelper
parent875abc7774e5fb72bc764e0ae8004a85cc9dd14f (diff)
Use o3tl::make_unsigned, location is already checked to be non-negative here
Change-Id: Id052b9628e8df6d0e8b61b66f6ddc64d925427ad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135321 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/source/streaming/memorystream.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/comphelper/source/streaming/memorystream.cxx b/comphelper/source/streaming/memorystream.cxx
index 98431e318380..8bf3c3e90f5c 100644
--- a/comphelper/source/streaming/memorystream.cxx
+++ b/comphelper/source/streaming/memorystream.cxx
@@ -33,6 +33,7 @@
#include <comphelper/bytereader.hxx>
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/supportsservice.hxx>
+#include <o3tl/safeint.hxx>
#include <osl/diagnose.h>
#include <string.h>
@@ -185,7 +186,7 @@ void SAL_CALL UNOMemoryStream::seek( sal_Int64 location )
throw IllegalArgumentException("this implementation does not support more than 2GB!", static_cast<OWeakObject*>(this), 0 );
// seek operation should be able to resize the stream
- if ( location > static_cast< sal_Int64 >( maData.size() ) )
+ if ( o3tl::make_unsigned(location) > maData.size() )
maData.resize( static_cast< sal_Int32 >( location ) );
mnCursor = static_cast< sal_Int32 >( location );