[gnumeric] xls: fix minor problem reading old objects.



commit 7a8bedff8252813cfd64eeb2fc0eb0eeb5474033
Author: Morten Welinder <terra gnome org>
Date:   Mon Apr 4 11:17:54 2011 -0400

    xls: fix minor problem reading old objects.

 NEWS                    |    1 +
 plugins/excel/ChangeLog |    5 +++++
 plugins/excel/ms-obj.c  |    5 +++--
 3 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/NEWS b/NEWS
index 8360b8f..458c319 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,7 @@ Andreas:
 Morten:
 	* Fix problems with localized function docs.
 	* Plug leak.
+	* Fix minor problem reading old xls objects.
 
 --------------------------------------------------------------------------
 Gnumeric 1.10.14
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index 176a06e..b2a47b9 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,3 +1,8 @@
+2011-04-04  Morten Welinder  <terra gnome org>
+
+	* ms-obj.c (ms_obj_read_pre_biff8_obj): Improve record length
+	check.
+
 2011-03-24  Morten Welinder <terra gnome org>
 
 	* Release 1.10.14
diff --git a/plugins/excel/ms-obj.c b/plugins/excel/ms-obj.c
index c36d874..161a52b 100644
--- a/plugins/excel/ms-obj.c
+++ b/plugins/excel/ms-obj.c
@@ -663,9 +663,10 @@ ms_obj_read_pre_biff8_obj (BiffQuery *q, MSContainer *c, MSObj *obj)
 	gboolean has_name;
 	guint8 *anchor;
 
-	XL_CHECK_CONDITION_VAL (q->length >= 32, TRUE);
+	XL_CHECK_CONDITION_VAL (q->length >= 26, TRUE);
 
-	has_name = GSF_LE_GET_GUINT16 (q->data+30) != 0; /* undocumented */
+	has_name = (q->length >= 32 &&
+		    GSF_LE_GET_GUINT16 (q->data+30) != 0); /* undocumented */
 #if 0
 	guint16 const flags = GSF_LE_GET_GUINT16(q->data+8);
 #endif



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