[gnumeric] Survive malformed guppi graphs. [#625726]



commit cb8d6b0f01a40521a758c7f54aaa63ad82698102
Author: Jean Brefort <jean brefort normalesup org>
Date:   Sat Jul 31 20:23:31 2010 +0200

    Survive malformed guppi graphs. [#625726]

 ChangeLog                |    5 +++++
 NEWS                     |    1 +
 src/sheet-object-graph.c |    2 +-
 3 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 5a19e3b..fbb569e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2010-07-31  Jean Brefort  <jean brefort normalesup org>
 
+	* src/sheet-object-graph.c (dim_start): survive malformed guppi graphs.
+	[#625726]
+
+2010-07-31  Jean Brefort  <jean brefort normalesup org>
+
 	* src/sheet-object-graph.c (gnm_sog_prep_sax_parser),
 	(sheet_object_graph_ensure_size), (vector_start), (vector_end),
 	(plot_type_start), (series_start), (dim_start), (marker_end),
diff --git a/NEWS b/NEWS
index 40ab556..c8d39af 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,7 @@ Andreas:
 
 Jean:
 	* Import Guppi graphs from gnumeric-1.0.x files. [#567953]
+	* Survive malformed guppi graphs. [#625726]
 
 --------------------------------------------------------------------------
 Gnumeric 1.10.8
diff --git a/src/sheet-object-graph.c b/src/sheet-object-graph.c
index 6c5a9fd..ceb3641 100644
--- a/src/sheet-object-graph.c
+++ b/src/sheet-object-graph.c
@@ -878,7 +878,7 @@ dim_start (GsfXMLIn *xin, xmlChar const **attrs)
 			name = attrs[i+1];
 		else if (0 == strcmp (attrs[i], "ID"))
 			id = strtoul (attrs[i+1], NULL, 10);
-	if (id > 255)
+	if (id > state->data->len || g_ptr_array_index (state->data, id) == NULL)
 		return;
 	if (0 == strcmp (name, "values"))
 		type = GOG_MS_DIM_VALUES;



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