[gnumeric] xls: fix fuzz crash.



commit cc09e2d2e2a42a3b79c9d41fac68e0da0bd33d9b
Author: Morten Welinder <terra gnome org>
Date:   Tue Aug 20 15:12:28 2013 -0400

    xls: fix fuzz crash.
    
    When we collect ranges with validation we also get input message areas.

 NEWS                           |    2 +-
 plugins/excel/ChangeLog        |    5 +++++
 plugins/excel/ms-excel-write.c |    8 ++++----
 src/sheet-style.c              |   10 +++++-----
 4 files changed, 15 insertions(+), 10 deletions(-)
---
diff --git a/NEWS b/NEWS
index c0c368f..873086d 100644
--- a/NEWS
+++ b/NEWS
@@ -1,7 +1,7 @@
 Gnumeric 1.12.6
 
 Morten:
-       * Fix crash on corrupted files.  [#706413]
+       * Fix crash on corrupted files.  [#706413]  [#706417]
 
 --------------------------------------------------------------------------
 Gnumeric 1.12.5
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index 978a75c..6ef921f 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,3 +1,8 @@
+2013-08-20  Morten Welinder  <terra gnome org>
+
+       * ms-excel-write.c (excel_write_prep_validations): Handle range
+       with no validation (and therefore with an input message).
+
 2013-08-19  Morten Welinder <terra gnome org>
 
        * Release 1.12.5
diff --git a/plugins/excel/ms-excel-write.c b/plugins/excel/ms-excel-write.c
index 4a737c6..eb7a81a 100644
--- a/plugins/excel/ms-excel-write.c
+++ b/plugins/excel/ms-excel-write.c
@@ -1508,12 +1508,12 @@ static void
 excel_write_prep_validations (ExcelWriteSheet *esheet)
 {
        GnmStyleList *ptr = esheet->validations;
-       GnmStyleRegion const *sr;
-       GnmValidation  const *v;
 
        for (; ptr != NULL ; ptr = ptr->next) {
-               sr = ptr->data;
-               v  = gnm_style_get_validation (sr->style);
+               GnmStyleRegion const *sr = ptr->data;
+               GnmValidation  const *v = gnm_style_get_validation (sr->style);
+               if (!v)
+                       continue;
                if (v->deps[0].texpr != NULL)
                        excel_write_prep_expr (esheet->ewb, v->deps[0].texpr);
                if (v->deps[1].texpr != NULL)
diff --git a/src/sheet-style.c b/src/sheet-style.c
index a641eb5..2b363cf 100644
--- a/src/sheet-style.c
+++ b/src/sheet-style.c
@@ -816,7 +816,7 @@ sheet_style_shutdown (Sheet *sheet)
 
 /**
  * sheet_style_set_auto_pattern_color:
- * @sheet:         The sheet
+ * @sheet: The sheet
  * @grid_color: The color
  *
  * Set the color for rendering auto colored patterns in this sheet.
@@ -2954,11 +2954,11 @@ style_validation_filter (GnmStyle const *style)
 
 /**
  * sheet_style_collect_validations:
- * @sheet:
- * @r:
+ * @sheet: the to trawl
+ * @r: (allow-none): range to restrict to
  *
- * Returns: (transfer full): a list of areas with validation, Caller is
- * responsible for freeing.
+ * Returns: (transfer full): a list of areas with validation or input
+ * message.
  **/
 GnmStyleList *
 sheet_style_collect_validations (Sheet const *sheet, GnmRange const *r)


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