[Libreoffice-commits] core.git: package/source

Caolán McNamara caolanm at redhat.com
Fri Jan 19 08:52:10 UTC 2018


 package/source/zipapi/XUnbufferedStream.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 713b261b59e3636890b6a5736c6a3fcc0be647a8
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Jan 18 20:54:22 2018 +0000

    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 at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

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;
 


More information about the Libreoffice-commits mailing list