[gnumeric] Fuzzed file fix. [#751920]



commit 958fc33bec2a95fe22bb1c86ffe800c6a002c0a0
Author: Jean Brefort <jean brefort normalesup org>
Date:   Sat Jul 4 08:18:02 2015 +0200

    Fuzzed file fix. [#751920]

 NEWS                     |    2 +-
 plugins/excel/ChangeLog  |    5 +++++
 plugins/excel/ms-chart.c |    5 ++++-
 3 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/NEWS b/NEWS
index 0e44453..1a780a7 100644
--- a/NEWS
+++ b/NEWS
@@ -15,7 +15,7 @@ Jean:
        * Fix xlsx import of plot area manual layout. [#748016]
        * Fix out of bounds read. [#749121]
        * Fuzzed file fixes.  [#750042] [#751217] [#751270] [#751271]
-          [#751383] [#751384] [#751758] [751744] [751908]
+         [#751383] [#751384] [#751758] [#751744] [#751908] [#751920]
 
 Morten:
        * Fix import/export of graph backplane.
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index ac2fbc4..08ffc18 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,3 +1,8 @@
+2015-07-04  Jean Brefort  <jean brefort normalesup org>
+
+       * ms-chart.c (xl_chart_import_trend_line): add check for array index in
+       xl_chart_import_trend_line(). Fixes #751920.
+
 2015-07-03  Jean Brefort  <jean brefort normalesup org>
 
        * ms-chart.c (end): protect against missing value. Fixes #751908.
diff --git a/plugins/excel/ms-chart.c b/plugins/excel/ms-chart.c
index e1e3b63..446cbb2 100644
--- a/plugins/excel/ms-chart.c
+++ b/plugins/excel/ms-chart.c
@@ -3422,7 +3422,10 @@ xl_chart_import_trend_line (XLChartReadState *state, XLChartSeries *series)
 {
        GogTrendLine *rc;
        Sheet *sheet;
-       XLChartSeries *parent = g_ptr_array_index (state->series, series->reg_parent);
+       XLChartSeries *parent;
+
+       XL_CHECK_CONDITION ((unsigned) series->reg_parent < state->series->len);
+       parent = g_ptr_array_index (state->series, series->reg_parent);
 
        XL_CHECK_CONDITION (parent != NULL && parent->series != NULL);
 


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