cid#982783 Unintentional integer overflow

Change-Id: Ida52d1fbe3d84c9c0070c91ae24cae58dc4aa13f
This commit is contained in:
Noel Grandin
2014-05-14 09:45:34 +02:00
parent 3c42d5e414
commit 8c004aa108

View File

@@ -1097,7 +1097,7 @@ void ZipFile::getSizeAndCRC( sal_Int64 nOffset, sal_Int64 nCompressedSize, sal_I
sal_Int32 nBlockSize = static_cast< sal_Int32 > (::std::min( nCompressedSize, static_cast< sal_Int64 >( 32000 ) ) ); sal_Int32 nBlockSize = static_cast< sal_Int32 > (::std::min( nCompressedSize, static_cast< sal_Int64 >( 32000 ) ) );
aGrabber.seek( nOffset ); aGrabber.seek( nOffset );
for ( int ind = 0; for ( sal_Int64 ind = 0;
!aInflaterLocal.finished() && aGrabber.readBytes( aBuffer, nBlockSize ) && ind * nBlockSize < nCompressedSize; !aInflaterLocal.finished() && aGrabber.readBytes( aBuffer, nBlockSize ) && ind * nBlockSize < nCompressedSize;
ind++ ) ind++ )
{ {