[gnumeric] Graph: don't crash on corrupted graph.



commit 176d4860f91b49f79b6ac460d96c3f54214d689f
Author: Morten Welinder <terra gnome org>
Date:   Fri Jun 14 10:35:02 2013 -0400

    Graph: don't crash on corrupted graph.

 ChangeLog                |    2 ++
 NEWS                     |    3 ++-
 src/sheet-object-graph.c |    3 ++-
 3 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 2f2b827..99c7b20 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2013-06-14  Morten Welinder  <terra gnome org>
 
+       * src/sheet-object-graph.c (dim_start): Don't crash on NULL desc.
+
        * src/workbook.c (workbook_sheet_delete): Debug.
        (workbook_dispose): Also clear style here.  Styles can have
        dependents now.  Fixes #702218.
diff --git a/NEWS b/NEWS
index 5c07f65..2e92935 100644
--- a/NEWS
+++ b/NEWS
@@ -58,7 +58,8 @@ Morten:
        * Introspection fixes.
        * Fix xls/biff5 link export.  [#701604]
        * Workaround problems with automake 1.13.
-       * Fix crashes on bogus xls file.  [#702101] [#702182]  [#702218]
+       * Fix crashes on corrupted files.  [#702101] [#702182]  [#702218]
+         [#702267]
 
 --------------------------------------------------------------------------
 Gnumeric 1.12.2
diff --git a/src/sheet-object-graph.c b/src/sheet-object-graph.c
index 28da73c..d85bd98 100644
--- a/src/sheet-object-graph.c
+++ b/src/sheet-object-graph.c
@@ -942,7 +942,8 @@ 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 > state->data->len || g_ptr_array_index (state->data, id) == NULL)
+       if (!desc ||
+           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]