[gnumeric] Fix crash on corrupted files. [#703149]



commit c9aecc93f1bbf9efdbea258cf6fb6deead5a7689
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Thu Jun 27 14:12:16 2013 -0600

    Fix crash on corrupted files. [#703149]
    
    2013-06-27  Andreas J. Guelzow <aguelzow pyrshep ca>
    
        * html_read.c (html_read_content): skip empty tables

 NEWS                     |    1 +
 plugins/html/ChangeLog   |    4 ++++
 plugins/html/html_read.c |    8 +++++---
 3 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/NEWS b/NEWS
index 5aede03..01a6f0f 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,7 @@ Andreas:
        * Improve xls import of Excel 2010 functions.
        * Fix documentation of r.q*.
        * Add Excel 2010's BETA.DIST.
+       * Fix crash on corrupted files. [#703149]
 
 Jean:
        * Don't attempt to add a path item when there is no path objecte. [#703052]
diff --git a/plugins/html/ChangeLog b/plugins/html/ChangeLog
index 3c73caf..671c021 100644
--- a/plugins/html/ChangeLog
+++ b/plugins/html/ChangeLog
@@ -1,3 +1,7 @@
+2013-06-27  Andreas J. Guelzow <aguelzow pyrshep ca>
+
+       * html_read.c (html_read_content): skip empty tables
+
 2013-06-25  Morten Welinder <terra gnome org>
 
        * Release 1.12.3
diff --git a/plugins/html/html_read.c b/plugins/html/html_read.c
index 3f7b921..7e6f9f9 100644
--- a/plugins/html/html_read.c
+++ b/plugins/html/html_read.c
@@ -152,9 +152,11 @@ html_read_content (htmlNodePtr cur, GString *buf, GnmStyle *mstyle,
                                tc->sheet = NULL;
                                tc->row   = -1;
                                html_read_table (ptr, doc, tc->wb_view, tc);
-                               g_string_append_printf (buf, _("[see sheet %s]"), tc->sheet->name_quoted);
-                               xmlBufferAdd (a_buf, CC2XML (_("The original html file is\n"
-                                                              "using nested tables.")), -1);
+                               if (tc->sheet) {
+                                       g_string_append_printf (buf, _("[see sheet %s]"), 
tc->sheet->name_quoted);
+                                       xmlBufferAdd (a_buf, CC2XML (_("The original html file is\n"
+                                                                      "using nested tables.")), -1);
+                               }
                                tc->sheet = last_sheet;
                                tc->row = last_row;
                        } else


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