[gnumeric] Sheet: crash avoidance if cells miss col/row info.



commit 5e61eb9d36c070f2354030d19b9da257abcfec41
Author: Morten Welinder <terra gnome org>
Date:   Sun May 6 18:27:38 2018 -0400

    Sheet: crash avoidance if cells miss col/row info.

 NEWS        |    1 +
 src/sheet.c |    8 ++++++++
 2 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/NEWS b/NEWS
index f68101f..9cedbcc 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,7 @@ Morten:
        * Fix problem with object pasting.
        * Fix undo problem for cell comments.  [#732653]
        * Exit with non-zero with we fail to load file on command line.
+       * Fix undo crash.  [#795861]
 
 --------------------------------------------------------------------------
 Gnumeric 1.12.40
diff --git a/src/sheet.c b/src/sheet.c
index 523dcfd..a947b62 100644
--- a/src/sheet.c
+++ b/src/sheet.c
@@ -4168,6 +4168,10 @@ sheet_foreach_cell_in_region (Sheet *sheet, CellIterFlags flags,
                                last_row = iter.pp.eval.row;
                                iter.ri = sheet_row_get (iter.pp.sheet, last_row);
                        }
+                       if (iter.ri == NULL) {
+                               g_critical ("Cell without row data -- please report");
+                               continue;
+                       }
                        if (visibility_matters && !iter.ri->visible)
                                continue;
                        if (ignore_filtered && iter.ri->in_filter && !iter.ri->visible)
@@ -4177,6 +4181,10 @@ sheet_foreach_cell_in_region (Sheet *sheet, CellIterFlags flags,
                                last_col = iter.pp.eval.col;
                                iter.ci = sheet_col_get (iter.pp.sheet, last_col);
                        }
+                       if (iter.ci == NULL) {
+                               g_critical ("Cell without column data -- please report");
+                               continue;
+                       }
                        if (visibility_matters && !iter.ci->visible)
                                continue;
 


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