diff options
author | Eike Rathke <erack@redhat.com> | 2014-03-19 01:05:28 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2014-03-19 01:06:37 +0100 |
commit | 90dd4320de6ace24e464979630a2c9fbab35f64b (patch) | |
tree | b89dae9fb80791a4ae3fe8f44dde566b2604e9de | |
parent | bbdbf199ebfd26f1844500bf175444c35885a2b4 (diff) |
check return of stream read and adapt vector size if necessary
Change-Id: I43d699b1e89ec327ec27566a98160a424216c78c
-rw-r--r-- | sc/source/filter/excel/excimp8.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx index c5008efae94a..4ffc3262bcd7 100644 --- a/sc/source/filter/excel/excimp8.cxx +++ b/sc/source/filter/excel/excimp8.cxx @@ -372,7 +372,9 @@ 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); - aIn.Read( &aProt.maSecurityDescriptor.front(), nCbSD); + sal_Size nRead = aIn.Read( &aProt.maSecurityDescriptor.front(), nCbSD); + if (nRead != nCbSD) + aProt.maSecurityDescriptor.resize( nRead); } GetSheetProtectBuffer().AppendEnhancedProtection( aProt, GetCurrScTab() ); |