resize vector in advance
Obtaining front() from an empty vector is disallowed, even if size was reserved. So resize it. Change-Id: Iae2aafd6b7b725ea36bf9c3fb0a2370c7037777f
This commit is contained in:
@@ -375,9 +375,10 @@ void ImportExcel8::Feat( void )
|
||||
{
|
||||
sal_uInt32 nCbSD = aIn.ReaduInt32();
|
||||
// TODO: could here be some sanity check applied to not allocate 4GB?
|
||||
aProt.maSecurityDescriptor.reserve( nCbSD);
|
||||
aProt.maSecurityDescriptor.resize( nCbSD);
|
||||
sal_Size nRead = aIn.Read( &aProt.maSecurityDescriptor.front(), nCbSD);
|
||||
aProt.maSecurityDescriptor.resize( nRead);
|
||||
if (nRead < nCbSD)
|
||||
aProt.maSecurityDescriptor.resize( nRead);
|
||||
}
|
||||
|
||||
GetSheetProtectBuffer().AppendEnhancedProtection( aProt, GetCurrScTab() );
|
||||
|
Reference in New Issue
Block a user