summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-01-18 20:54:22 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-01-19 09:51:45 +0100
commit713b261b59e3636890b6a5736c6a3fcc0be647a8 (patch)
tree3c068569e2a4173f33c7ea8d2d1ece91d163482c /package
parent64c9bda0b9d43a4b4cc1d40068f0d0fb261fb5b4 (diff)
crashtesting: failure on import with bogus values
regression from... commit 7d8e94444d989d0ac4a4055b207726708e9ec0da Date: Thu Jan 11 08:47:15 2018 +0200 convert a<b?a:b to std::min(a,b) cause old promotion was to the largest type, so with a large 64bit nDiff and any 32bit nRequestedBytes the nRequestedBytes was promoted to 64bit, found to be smaller than nDiff, then would fit in 32bit. newer code cast both to 32bit, resulting in a negative nDiff which was smaller than nRequestedBytes, but going on to cause havoc. Change-Id: I9eb5c61302b3dccf5333c4dfbf9ac92ce49585b5 Reviewed-on: https://gerrit.libreoffice.org/48155 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'package')
-rw-r--r--package/source/zipapi/XUnbufferedStream.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/package/source/zipapi/XUnbufferedStream.cxx b/package/source/zipapi/XUnbufferedStream.cxx
index 1f992ca14e58..0aedfac09402 100644
--- a/package/source/zipapi/XUnbufferedStream.cxx
+++ b/package/source/zipapi/XUnbufferedStream.cxx
@@ -210,7 +210,7 @@ sal_Int32 SAL_CALL XUnbufferedStream::readBytes( Sequence< sal_Int8 >& aData, sa
nRead = mxZipStream->readBytes (
aData,
- std::min<sal_Int32>(nDiff, nRequestedBytes) );
+ std::min<sal_Int64>(nDiff, nRequestedBytes) );
mnZipCurrent += nRead;