[gnumeric] xlsx: hardening.



commit 3ee54f56bfe200fac9dfd917dacc213b6d9e5d70
Author: Morten Welinder <terra gnome org>
Date:   Wed May 6 21:58:19 2015 -0400

    xlsx: hardening.

 NEWS                              |    2 +-
 plugins/excel/xlsx-read-color.c   |    2 ++
 plugins/excel/xlsx-read-drawing.c |    4 ++--
 3 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/NEWS b/NEWS
index 4743392..71dcb1f 100644
--- a/NEWS
+++ b/NEWS
@@ -13,7 +13,7 @@ Morten:
        * Fix xlsx save crash related to shared strings.  [#748477]
        * Solver code refactoring.
        * Plug leaks.
-       * Fuzzed file fixes.  [#748595]  [#748597]
+       * Fuzzed file fixes.  [#748595]  [#748597] [#749031]
        * Make solver check linearity of model.
 
 --------------------------------------------------------------------------
diff --git a/plugins/excel/xlsx-read-color.c b/plugins/excel/xlsx-read-color.c
index 3175468..c5d21d8 100644
--- a/plugins/excel/xlsx-read-color.c
+++ b/plugins/excel/xlsx-read-color.c
@@ -190,6 +190,8 @@ color_set_helper (XLSXReadState *state)
        g_printerr ("color: #%08x in state %d\n",
                    state->color, state->chart_color_state & 7);
 #endif
+       if (!state->cur_style)
+               return;
 
        switch (state->chart_color_state & 7) {
        default:
diff --git a/plugins/excel/xlsx-read-drawing.c b/plugins/excel/xlsx-read-drawing.c
index 56c4dbb..4b3eee4 100644
--- a/plugins/excel/xlsx-read-drawing.c
+++ b/plugins/excel/xlsx-read-drawing.c
@@ -1729,7 +1729,7 @@ xlsx_chart_pt_end (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
 {
        XLSXReadState *state = (XLSXReadState *)xin->user_state;
        xlsx_chart_pop_obj (state);
-       if (!state->series_pt_has_index) {
+       if (!state->series_pt_has_index && state->series_pt) {
                gog_object_clear_parent (state->series_pt);
                g_object_unref (state->series_pt);
        }
@@ -1742,7 +1742,7 @@ xlsx_chart_pt_index (GsfXMLIn *xin, xmlChar const **attrs)
        XLSXReadState *state = (XLSXReadState *)xin->user_state;
        unsigned idx;
 
-       if (simple_uint (xin, attrs, &idx)) {
+       if (simple_uint (xin, attrs, &idx) && state->series_pt) {
                state->series_pt_has_index = TRUE;
                g_object_set (state->series_pt, "index", idx, NULL);
        }


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