ooo-build r13950 - in branches/ooo-build-3-0: . patches/dev300



Author: kyoshida
Date: Thu Sep 18 19:36:26 2008
New Revision: 13950
URL: http://svn.gnome.org/viewvc/ooo-build?rev=13950&view=rev

Log:
2008-09-18  Kohei Yoshida  <kyoshida novell com>

	* patches/dev300/cws-scsheetprotection02-sc.diff: fixed a crash on 
	loading Excel 95 files with document/sheet protection due to "stack 
	smashing".  Basically it tried to de-reference a NULL pointer and call
	its method, which led to a crash (n#427434).


Modified:
   branches/ooo-build-3-0/ChangeLog
   branches/ooo-build-3-0/patches/dev300/cws-scsheetprotection02-sc.diff

Modified: branches/ooo-build-3-0/patches/dev300/cws-scsheetprotection02-sc.diff
==============================================================================
--- branches/ooo-build-3-0/patches/dev300/cws-scsheetprotection02-sc.diff	(original)
+++ branches/ooo-build-3-0/patches/dev300/cws-scsheetprotection02-sc.diff	Thu Sep 18 19:36:26 2008
@@ -1481,13 +1481,10 @@
      XclExpEmptyRecord( EXC_ID_FILTERMODE )
  {
 Index: sc/source/filter/excel/impop.cxx
-===================================================================
-RCS file: /cvs/sc/sc/source/filter/excel/impop.cxx,v
-retrieving revision 1.95
-retrieving revision 1.93.26.3
-diff -u -I $Revision.*$ -I $Author.*$ -r1.95 -r1.93.26.3
---- sc/source/filter/excel/impop.cxx	8 Jul 2008 07:22:25 -0000	1.95
-+++ sc/source/filter/excel/impop.cxx	17 Jul 2008 01:00:46 -0000	1.93.26.3
+diff --git sc/source/filter/excel/impop.cxx sc/source/filter/excel/impop.cxx
+index ab1ca87..b532a58 100644
+--- sc/source/filter/excel/impop.cxx
++++ sc/source/filter/excel/impop.cxx
 @@ -90,6 +90,7 @@
  #include "xiview.hxx"
  #include "xilink.hxx"
@@ -1496,7 +1493,7 @@
  
  #include "excimp8.hxx"
  #include "excform.hxx"
-@@ -418,14 +419,9 @@
+@@ -418,14 +419,12 @@ void ImportExcel::Eof( void )
  }
  
  
@@ -1505,20 +1502,25 @@
  {
 -	// POST: return = TRUE, wenn Password <> 0
 -	UINT16 nPasswd;
--
++    if (GetRoot().GetBiff() != EXC_BIFF8)
++        return;
+ 
 -	aIn >> nPasswd;
 -
 -	return nPasswd != 0x0000;
-+    GetSheetProtectBuffer().ReadPasswordHash( aIn, GetCurrScTab() );
++    GetRoot().GetSheetProtectBuffer().ReadPasswordHash( aIn, GetCurrScTab() );
  }
  
  
-@@ -439,6 +435,12 @@
+@@ -439,6 +438,15 @@ void ImportExcel::Externsheet( void )
  }
  
  
 +void ImportExcel:: WinProtection( void )
 +{
++    if (GetRoot().GetBiff() != EXC_BIFF8)
++        return;
++
 +    GetRoot().GetDocProtectBuffer().ReadWinProtect( aIn );
 +}
 +
@@ -1526,7 +1528,7 @@
  void ImportExcel::Note( void )
  {
      XclAddress aXclPos;
-@@ -584,27 +586,24 @@
+@@ -584,27 +592,33 @@ void ImportExcel::Defrowheight2( void )
  }
  
  
@@ -1538,6 +1540,9 @@
 -        uno::Sequence<sal_Int8> aEmptyPass;
 -        GetDoc().SetTabProtection( GetCurrScTab(), TRUE, aEmptyPass );
 -    }
++    if (GetRoot().GetBiff() != EXC_BIFF8)
++        return;
++
 +    GetRoot().GetSheetProtectBuffer().ReadProtect( aIn, GetCurrScTab() );
  }
  
@@ -1548,11 +1553,17 @@
 -        uno::Sequence<sal_Int8> aEmptyPass;
 -        GetDoc().SetDocProtection( TRUE, aEmptyPass );
 -    }
++    if (GetRoot().GetBiff() != EXC_BIFF8)
++        return;
++
 +    GetRoot().GetDocProtectBuffer().ReadDocProtect( aIn );
  }
  
 +void ImportExcel::DocPasssword( void )
 +{
++    if (GetRoot().GetBiff() != EXC_BIFF8)
++        return;
++
 +    GetRoot().GetDocProtectBuffer().ReadPasswordHash( aIn );
 +}
  



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]