[gnumeric] Fix crash on bogus gnumeric file. [#702219]



commit d26f260942f36f5ca9b698ec5e29e20dae5fa842
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Fri Jun 14 01:57:13 2013 -0600

    Fix crash on bogus gnumeric file.  [#702219]
    
    2013-06-14  Andreas J. Guelzow <aguelzow pyrshep ca>
    
        * src/sheet-view.c (sv_sheet_r1c1_changed): check for NULL selection

 ChangeLog        |    4 ++++
 NEWS             |    1 +
 src/sheet-view.c |    6 +++---
 3 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index efd563b..e10a61c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2013-06-14  Andreas J. Guelzow <aguelzow pyrshep ca>
+
+       * src/sheet-view.c (sv_sheet_r1c1_changed): check for NULL selection
+
 2013-06-12  Morten Welinder  <terra gnome org>
 
        * src/sheet-merge.c (gnm_sheet_merge_add): Ensure range is sane.
diff --git a/NEWS b/NEWS
index 3b4338a..cebf399 100644
--- a/NEWS
+++ b/NEWS
@@ -24,6 +24,7 @@ Andreas:
        * Fix ODF crash. [#702197]
        * In ODF import ignored mentioned but not included sheets. [#698388]
        * Fix crash on bogus ODF file.  [#702205]
+       * Fix crash on bogus gnumeric file.  [#702219]
 
 Darrell Tangman:
        * Update documentation for Edit and Insert menus. [#700596]
diff --git a/src/sheet-view.c b/src/sheet-view.c
index 58d43a5..a2033e1 100644
--- a/src/sheet-view.c
+++ b/src/sheet-view.c
@@ -91,7 +91,7 @@ sv_sheet_visibility_changed (Sheet *sheet,
 }
 
 static void
-sv_sheet_r1c1_changed (Sheet *sheet,
+sv_sheet_r1c1_changed (G_GNUC_UNUSED Sheet *sheet,
                       G_GNUC_UNUSED GParamSpec *pspec,
                       SheetView *sv)
 {
@@ -710,8 +710,8 @@ sv_selection_intersects_filter_rows (SheetView const *sv)
        g_return_val_if_fail (IS_SHEET_VIEW (sv), NULL);
        r = selection_first_range (sv, NULL, NULL);
 
-       return gnm_sheet_filter_intersect_rows
-               (sv->sheet, r->start.row, r->end.row);
+       return r ? gnm_sheet_filter_intersect_rows
+         (sv->sheet, r->start.row, r->end.row) : NULL;
 }
 
 /**


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