Index: source/sdstor/stgelem.cxx =================================================================== RCS file: /cvs/util/sot/source/sdstor/stgelem.cxx,v retrieving revision 1.9.50.2 diff -u -r1.9.50.2 stgelem.cxx --- source/sdstor/stgelem.cxx 20 May 2008 12:18:33 -0000 1.9.50.2 +++ source/sdstor/stgelem.cxx 18 Jul 2008 11:48:37 -0000 @@ -163,12 +164,18 @@ 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