summaryrefslogtreecommitdiff
path: root/sot/source/sdstor/stgelem.cxx
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2008-11-19 13:34:57 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2008-11-19 13:34:57 +0000
commit5202aa22b98b063f3e969d6de29a0c3578f00dac (patch)
treec24eae2ccb8d8db9c320c7619523af8eee74a11d /sot/source/sdstor/stgelem.cxx
parent7f5f6b548d071d412efb78e9fee21d68ad6700bc (diff)
CWS-TOOLING: integrate CWS fwk94_DEV300
Diffstat (limited to 'sot/source/sdstor/stgelem.cxx')
-rw-r--r--sot/source/sdstor/stgelem.cxx12
1 files changed, 9 insertions, 3 deletions
diff --git a/sot/source/sdstor/stgelem.cxx b/sot/source/sdstor/stgelem.cxx
index 5c0a7a009e94..d6fc8ce8f241 100644
--- a/sot/source/sdstor/stgelem.cxx
+++ b/sot/source/sdstor/stgelem.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: stgelem.cxx,v $
- * $Revision: 1.12 $
+ * $Revision: 1.12.6.1 $
*
* This file is part of OpenOffice.org.
*
@@ -158,12 +158,18 @@ BOOL StgHeader::Store( StgIo& rIo )
return BOOL( !bDirty );
}
-// Perform thorough checks also on unknown variables
+static bool lcl_wontoverflow(short shift)
+{
+ return shift >= 0 && shift < (short)sizeof(short) * 8 - 1;
+}
+// Perform thorough checks also on unknown variables
BOOL StgHeader::Check()
{
return BOOL( memcmp( cSignature, cStgSignature, 8 ) == 0
- && (short) ( nVersion >> 16 ) == 3 );
+ && (short) ( nVersion >> 16 ) == 3 )
+ && lcl_wontoverflow(nPageSize)
+ && lcl_wontoverflow(nDataPageSize);
}
INT32 StgHeader::GetFATPage( short n ) const