summaryrefslogtreecommitdiff
path: root/sot
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2022-06-03 13:48:58 +0200
committerStephan Bergmann <sbergman@redhat.com>2022-06-03 15:11:05 +0200
commitae5b06e346ca01bfbc0370632750e5a7c6154e46 (patch)
tree5ddde8afa9ee9b2d44989e144071abe59a495fa9 /sot
parent6af99a90d059446d028cb6fe94c7c74140f2ed02 (diff)
Use o3tl::make_unsigned, nStrLen is known to be non-negative here
Change-Id: Ibb51c5b47edefe3f22a3d4335bc3136988c65486 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135355 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sot')
-rw-r--r--sot/source/sdstor/stgole.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/sot/source/sdstor/stgole.cxx b/sot/source/sdstor/stgole.cxx
index bee4feb8842d..ac23f7a14555 100644
--- a/sot/source/sdstor/stgole.cxx
+++ b/sot/source/sdstor/stgole.cxx
@@ -22,6 +22,7 @@
#include "stgelem.hxx"
#include "stgole.hxx"
+#include <o3tl/safeint.hxx>
#include <sot/storinfo.hxx>
///////////////////////// class StgInternalStream
@@ -116,7 +117,7 @@ bool StgCompObjStream::Load()
std::unique_ptr<char[]> p(new char[ nStrLen+1 ]);
p[nStrLen] = 0;
- if (static_cast<sal_Int32>(ReadBytes( p.get(), nStrLen )) == nStrLen)
+ if (ReadBytes( p.get(), nStrLen ) == o3tl::make_unsigned(nStrLen))
{
//The encoding here is "ANSI", which is pretty useless seeing as
//the actual codepage used doesn't seem to be specified/stored