gnumeric r16311 - in trunk: . plugins/excel



Author: mortenw
Date: Wed Jan 30 02:51:59 2008
New Revision: 16311
URL: http://svn.gnome.org/viewvc/gnumeric?rev=16311&view=rev

Log:
2008-01-29  Morten Welinder  <terra gnome org>

	* ms-excel-read.c (excel_read_EXTERNSHEET_v8): Check q->length
	properly.  Fixes #512984.



Modified:
   trunk/NEWS
   trunk/plugins/excel/ChangeLog
   trunk/plugins/excel/ms-excel-read.c

Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS	(original)
+++ trunk/NEWS	Wed Jan 30 02:51:59 2008
@@ -16,6 +16,7 @@
 	* Fix inter-sheet cut problem.  [#511706]
 	* Fix loading of solver constraints.
 	* Fix solver issue.  [#512500]
+	* Fix corrupted-xls-file problem.  [#512984]
 
 --------------------------------------------------------------------------
 Gnumeric 1.8.0

Modified: trunk/plugins/excel/ms-excel-read.c
==============================================================================
--- trunk/plugins/excel/ms-excel-read.c	(original)
+++ trunk/plugins/excel/ms-excel-read.c	Wed Jan 30 02:51:59 2008
@@ -5406,7 +5406,10 @@
 
 	XL_CHECK_CONDITION (importer->ver >= MS_BIFF_V8);
 	g_return_if_fail (importer->v8.externsheet == NULL);
+
+	XL_CHECK_CONDITION (q->length >= 2);
 	num = GSF_LE_GET_GUINT16 (q->data);
+	XL_CHECK_CONDITION (q->length >= 2 + num * 6);
 
 	d (2, fprintf (stderr,"ExternSheet (%d entries)\n", num););
 	d (10, gsf_mem_dump (q->data, q->length););



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