Package: gnumeric
Version: 1.8.3-5
Severity: important

Gnumeric segfaults while loading files written by older versions of
gnumeric which contain empty attributes in gnm:StyleRegion.

The first attached file triggers the segfault; the second attached
file[1] has the empty attributes removed, and does not trigger the
segfault. [They were removed by the following trivial perl snippet:
perl -pi.bak2 -e 'BEGIN {$/=undef};
                  s{<gnm:StyleRegion>.+?</gnm:StyleRegion>}{}sg' \
temp.gnumeric;]

The following patch fixes the segfault, but this isn't the correct fix
for the actual problem. [I have also verified that this problem
reproduces in the version in experimental.]

--- gnumeric-1.9.3.orig/src/xml-sax-read.c
+++ gnumeric-1.9.3/src/xml-sax-read.c
@@ -252,7 +252,7 @@
 xml_sax_attr_range (xmlChar const * const *attrs, GnmRange *res)
 {
        int flags = 0;
-       for (; attrs[0] && attrs[1] ; attrs += 2)
+       for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2)
                if (gnm_xml_attr_int (attrs, "startCol", &res->start.col))
                        flags |= 0x1;
                else if (gnm_xml_attr_int (attrs, "startRow", &res->start.row))



Don Armstrong

1: The attached files are seating charts from a class I taught in 2006
with the values foo-ized.
-- 
Junkies were all knitted together in a loose global macrame, the
intercontinental freemasonry of narcotics.
 -- Bruce Sterling, _Holy Fire_ p257

http://www.donarmstrong.com              http://rzlab.ucr.edu



-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to