gnumeric r17061 - in trunk: . src



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

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


Modified:
   trunk/ChangeLog
   trunk/src/xml-sax-read.c

Modified: trunk/src/xml-sax-read.c
==============================================================================
--- trunk/src/xml-sax-read.c	(original)
+++ trunk/src/xml-sax-read.c	Sun Jan 11 15:11:30 2009
@@ -252,6 +252,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;
@@ -1244,6 +1247,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]