[libgsf] Fix crash on encountering user defined meta data of default type. [649827]



commit a4bd4e775fd8fe2c82e6edac64933f50ac1bea7e
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Mon May 9 14:39:28 2011 -0600

    Fix crash on encountering user defined meta data of default type. [649827]
    
    2011-05-09  Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* gsf/gsf-opendoc-utils.c (od_meta_user_defined): initialize type
    	and name.

 ChangeLog               |    5 +++++
 NEWS                    |    4 ++++
 gsf/gsf-opendoc-utils.c |    4 ++++
 3 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 141c4bd..7b735cf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-05-09  Andreas J. Guelzow <aguelzow pyrshep ca>
+
+	* gsf/gsf-opendoc-utils.c (od_meta_user_defined): initialize type
+	and name.
+
 2011-05-02  Jean Brefort  <jean brefort normalesup org>
 
 	* gsf/gsf-impl-utils.h: fix GSF_DYNAMIC_CLASS_FULL to make gcc-4.6 happy.
diff --git a/NEWS b/NEWS
index 7fafd7c..2786850 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,9 @@
 libgsf 1.14.21
 
+Andreas:
+	* Fix crash on encountering user defined meta data of default 
+	type. [649827]
+
 Gilles Dartiguelongue:
 	* Implement --without-gconf for explicit dependency control.  [#645775]
 	* Fix python compilation problem.  [#645778]
diff --git a/gsf/gsf-opendoc-utils.c b/gsf/gsf-opendoc-utils.c
index 5037f64..477e387 100644
--- a/gsf/gsf-opendoc-utils.c
+++ b/gsf/gsf-opendoc-utils.c
@@ -211,6 +211,8 @@ static void
 od_meta_user_defined (GsfXMLIn *xin,  xmlChar const **attrs)
 {
 	GsfOOMetaIn *mi = (GsfOOMetaIn *)xin->user_state;
+	mi->typ = G_TYPE_STRING;
+	mi->name = NULL;
 
 	for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2) {
 		if (!strcmp (CXML2C (attrs[0]), "meta:name"))
@@ -234,6 +236,8 @@ od_meta_user_defined (GsfXMLIn *xin,  xmlChar const **attrs)
 			}
 		}
 	}
+	if (mi->name == NULL) /* This should not happen */
+		mi->name = g_strdup ("");
 }
 
 static void



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