gnumeric r17062 - in branches/gnumeric-1-8: . src



Author: jdassen
Date: Sun Jan 11 15:14:22 2009
New Revision: 17062
URL: http://svn.gnome.org/viewvc/gnumeric?rev=17062&view=rev

Log:
Don't crash on old gnumeric files which have gnm:StyleRegion tags without
attributes in them. (Debian #510929)


Modified:
   branches/gnumeric-1-8/ChangeLog
   branches/gnumeric-1-8/src/xml-sax-read.c

Modified: branches/gnumeric-1-8/src/xml-sax-read.c
==============================================================================
--- branches/gnumeric-1-8/src/xml-sax-read.c	(original)
+++ branches/gnumeric-1-8/src/xml-sax-read.c	Sun Jan 11 15:14:22 2009
@@ -235,6 +235,9 @@
 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;
@@ -1227,6 +1230,11 @@
 	g_return_if_fail (state->style_range_init == FALSE);
 	g_return_if_fail (state->style == NULL);
 
+	if (attrs == NULL) {
+		g_warning ("Invalid tag: gnm:StyleRegion start tag without attributes");
+		return;
+	}
+
 	state->style = (state->version >= GNM_XML_V6 ||
 			state->version <= GNM_XML_V2)
 		? gnm_style_new_default ()



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