On Fri, Jan 09, 2009 at 01:42:17 -0800, Don Armstrong wrote:
> Heh; sorry about that; they should be attached now.

Thank you. Here's a patch against gnumeric SVN trunk that has it throw
warnings instead of crashing:

Index: ChangeLog
===================================================================
--- ChangeLog   (revision 17060)
+++ ChangeLog   (working copy)
@@ -1,3 +1,9 @@
+2009-01-11  J.H.M. Dassen (Ray) <jdas...@debian.org>
+
+       * src/xml-sax-read.c: (xml_sax_attr_range, xml_sax_style_region_start):
+       Don't crash on old gnumeric files which have gnm:StyleRegion tags
+       without attributes in them. (Debian #510929)
+
 2009-01-09  Jean Brefort  <jean.bref...@normalesup.org>
 
        * src/graph.c: (gnm_go_data_vector_get_str): set -1 as format length.
Index: src/xml-sax-read.c
===================================================================
--- src/xml-sax-read.c  (revision 17060)
+++ src/xml-sax-read.c  (working copy)
@@ -252,6 +252,9 @@ static gboolean
 xml_sax_attr_range (xmlChar const * const *attrs, GnmRange *res)
 {
        int flags = 0;
+
+       g_return_val_if_fail (attrs != NULL, FALSE);
+
        for (; attrs[0] && attrs[1] ; attrs += 2)
                if (gnm_xml_attr_int (attrs, "startCol", &res->start.col))
                        flags |= 0x1;
@@ -1243,6 +1246,7 @@ xml_sax_style_region_start (GsfXMLIn *xin, xmlChar
 
        g_return_if_fail (state->style_range_init == FALSE);
        g_return_if_fail (state->style == NULL);
+       g_return_if_fail (attrs != NULL);
 
        state->style = (state->version >= GNM_XML_V6 ||
                        state->version <= GNM_XML_V2)


I'll run this by upstream now.

Ray
-- 
Obsig: developing a new sig



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to