summaryrefslogtreecommitdiff
path: root/sot
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-04-18 13:50:00 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-04-20 20:40:19 +0100
commitdfeadd06cead27f5f5af857f8c89c1d953fc0c39 (patch)
tree595ac303e398c2633b8e7c8395744f71023fef16 /sot
parent49b981c6b248e00ae3a6e28dd568920a6149cf75 (diff)
coverity#705538 Unintentional integer overflow
Change-Id: I50f0701bea8f2f2e00a6b1396ba7cfbf5e0bd00c
Diffstat (limited to 'sot')
-rw-r--r--sot/source/sdstor/stgcache.cxx8
1 files 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;