summaryrefslogtreecommitdiff
path: root/sot
diff options
context:
space:
mode:
authorMikhail Voytenko <mav@openoffice.org>2010-09-28 16:11:29 +0200
committerMikhail Voytenko <mav@openoffice.org>2010-09-28 16:11:29 +0200
commit622f4846bb6e48873cbb00dc8a167a650b880f31 (patch)
treee9b29b0bae8821cea0729a00d33a264ecc5e0548 /sot
parentedec87cc81931221f823ab56a2182daca578ebd7 (diff)
fwk149: #i105142# avoid the crash in case of broken file
Diffstat (limited to 'sot')
-rw-r--r--sot/source/sdstor/stgdir.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/sot/source/sdstor/stgdir.cxx b/sot/source/sdstor/stgdir.cxx
index f093dc60cbe7..039a29fd2683 100644
--- a/sot/source/sdstor/stgdir.cxx
+++ b/sot/source/sdstor/stgdir.cxx
@@ -936,8 +936,11 @@ BOOL StgDirStrm::Store()
void* StgDirStrm::GetEntry( INT32 n, BOOL bDirty )
{
+ if( n < 0 )
+ return NULL;
+
n *= STGENTRY_SIZE;
- if( n >= nSize )
+ if( n < 0 && n >= nSize )
return NULL;
return GetPtr( n, TRUE, bDirty );
}