[Libreoffice-commits] core.git: sc/source

Eike Rathke erack at redhat.com
Tue Mar 18 17:07:08 PDT 2014


 sc/source/filter/excel/excimp8.cxx |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 90dd4320de6ace24e464979630a2c9fbab35f64b
Author: Eike Rathke <erack at redhat.com>
Date:   Wed Mar 19 01:05:28 2014 +0100

    check return of stream read and adapt vector size if necessary
    
    Change-Id: I43d699b1e89ec327ec27566a98160a424216c78c

diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx
index c5008ef..4ffc326 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() );


More information about the Libreoffice-commits mailing list