From dfeadd06cead27f5f5af857f8c89c1d953fc0c39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Fri, 18 Apr 2014 13:50:00 +0100 Subject: [PATCH] coverity#705538 Unintentional integer overflow Change-Id: I50f0701bea8f2f2e00a6b1396ba7cfbf5e0bd00c --- sot/source/sdstor/stgcache.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sot/source/sdstor/stgcache.cxx b/sot/source/sdstor/stgcache.cxx index 8754a53bc5a0..e82adf31920a 100644 --- a/sot/source/sdstor/stgcache.cxx +++ b/sot/source/sdstor/stgcache.cxx @@ -331,9 +331,9 @@ bool StgCache::Read( sal_Int32 nPage, void* pBuf, sal_Int32 nPg ) SetError( SVSTREAM_READ_ERROR ); else if ( nPage < nPages ) { - sal_uLong nPos = Page2Pos( nPage ); + sal_uInt32 nPos = Page2Pos( nPage ); sal_Int32 nPg2 = ( ( nPage + nPg ) > nPages ) ? nPages - nPage : nPg; - sal_uLong nBytes = nPg2 * nPageSize; + sal_uInt32 nBytes = nPg2 * nPageSize; // fixed address and size for the header if( nPage == -1 ) { @@ -362,8 +362,8 @@ bool StgCache::Write( sal_Int32 nPage, void* pBuf, sal_Int32 nPg ) { if( Good() ) { - sal_uLong nPos = Page2Pos( nPage ); - sal_uLong nBytes = 0; + sal_uInt32 nPos = Page2Pos( nPage ); + sal_uInt32 nBytes = 0; if ( SAL_MAX_INT32 / nPg > nPageSize ) nBytes = nPg * nPageSize;