Kaydet (Commit) 713b261b authored tarafından Caolán McNamara's avatar Caolán McNamara

crashtesting: failure on import with bogus values

regression from...

commit 7d8e9444
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/48155Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 64c9bda0
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment