Avoid undefined signed integer overflow
Change-Id: Idbb8109c36dfe1c8ed4acb8dff1a1538e386abd8
This commit is contained in:
parent
7bc0082106
commit
1d203f2d3f
1 changed files with 2 additions and 7 deletions
|
@ -967,13 +967,8 @@ bool StgDirStrm::Store()
|
|||
|
||||
void* StgDirStrm::GetEntry( sal_Int32 n, bool bDirty )
|
||||
{
|
||||
if( n < 0 )
|
||||
return NULL;
|
||||
|
||||
n *= STGENTRY_SIZE;
|
||||
if( n >= nSize )
|
||||
return NULL;
|
||||
return GetPtr( n, true, bDirty );
|
||||
return n < 0 || n >= nSize / STGENTRY_SIZE
|
||||
? NULL : GetPtr( n * STGENTRY_SIZE, true, bDirty );
|
||||
}
|
||||
|
||||
// Find a dir entry.
|
||||
|
|
Loading…
Reference in a new issue