fix undefined behavior with out-of-bounds substring access
Change-Id: Ie40d3dd2947d41b62eae84f20cfe457d69cc4bfe
This commit is contained in:
parent
383622a30d
commit
e880a88834
@ -220,9 +220,13 @@ OUString NameOrIndex::CheckNamedItem( const NameOrIndex* pCheckItem, const sal_u
|
||||
}
|
||||
else
|
||||
{
|
||||
sal_Int32 nThisIndex = pEntry->GetName().copy( aUser.getLength() ).toInt32();
|
||||
if( nThisIndex >= nUserIndex )
|
||||
nUserIndex = nThisIndex + 1;
|
||||
OUString aEntryName = pEntry->GetName();
|
||||
if(aEntryName.getLength() >= aUser.getLength())
|
||||
{
|
||||
sal_Int32 nThisIndex = aEntryName.copy( aUser.getLength() ).toInt32();
|
||||
if( nThisIndex >= nUserIndex )
|
||||
nUserIndex = nThisIndex + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user