[gnumeric] Printing: fix fuzzed file crash.



commit eecedcb83305f6e0dd8843a445113f1a2e58d846
Author: Morten Welinder <terra gnome org>
Date:   Tue Nov 19 07:48:58 2013 -0500

    Printing: fix fuzzed file crash.

 ChangeLog   |    5 +++++
 NEWS        |    2 +-
 src/print.c |    4 +++-
 3 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 298326f..aac44be 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-11-19  Morten Welinder  <terra gnome org>
+
+       * src/print.c (print_page): Fix check for missing object.  Fixes
+       #712662.
+
 2013-11-18  Morten Welinder  <terra gnome org>
 
        * src/sf-trig.c: Split out trigonometric functions from mathfunc.c
diff --git a/NEWS b/NEWS
index 9076c6a..2ce9c31 100644
--- a/NEWS
+++ b/NEWS
@@ -13,7 +13,7 @@ Morten:
        * Improve accuracy of COMBIN, PERMUT, POCHHAMMER, FACT, GAMMA.
        * Improve accuracy of bessel functions with large non-integer alpha.
        * Improve accuracy of ACOTH.
-       * Fix fuzzed file crash.  [#708091]
+       * Fix fuzzed file crash.  [#708091] [#712662]
        * Restore sheet reordering by drag.
        * Fix BETA on win32.
        * Fix win32 registry initialization.
diff --git a/src/print.c b/src/print.c
index 6fc235f..a71e873 100644
--- a/src/print.c
+++ b/src/print.c
@@ -565,7 +565,9 @@ print_page (G_GNUC_UNUSED GtkPrintOperation *operation,
        cairo_translate (cr, sheet->text_is_rtl ? width : 0, edge_to_below_header - header);
 
        if (sheet->sheet_type == GNM_SHEET_OBJECT) {
-               SheetObject *so = (SheetObject *) sheet->sheet_objects->data;
+               SheetObject *so = sheet->sheet_objects
+                       ? sheet->sheet_objects->data
+                       : NULL;
                if (so) {
                        cairo_scale (cr, px, py);
                        sheet_object_draw_cairo_sized (so, cr, width, height);


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