← Back to team overview

ayatana-commits team mailing list archive

[Merge] lp:~ted/dbusmenu/null-node-handling into lp:dbusmenu

 

Ted Gould has proposed merging lp:~ted/dbusmenu/null-node-handling into lp:dbusmenu.

Requested reviews:
  DBus Menu Team (dbusmenu-team)
Related bugs:
  #602444 SIGSEGV in parse_node_get_id (node=0x0)
  https://bugs.launchpad.net/bugs/602444


Check for NULL.
-- 
https://code.launchpad.net/~ted/dbusmenu/null-node-handling/+merge/29419
Your team ayatana-commits is subscribed to branch lp:dbusmenu.
=== modified file 'libdbusmenu-glib/client.c'
--- libdbusmenu-glib/client.c	2010-06-11 02:11:45 +0000
+++ libdbusmenu-glib/client.c	2010-07-07 19:47:39 +0000
@@ -561,6 +561,9 @@
 static gint
 parse_node_get_id (xmlNodePtr node)
 {
+	if (node == NULL) {
+		return -1;
+	}
 	if (node->type != XML_ELEMENT_NODE) {
 		return -1;
 	}
@@ -886,6 +889,10 @@
 
 	xmlNodePtr root = xmlDocGetRootElement(xmldoc);
 
+	if (root == NULL) {
+		g_warning("Unable to get root node of menu XML");
+	}
+
 	DbusmenuMenuitem * oldroot = priv->root;
 
 	priv->root = parse_layout_xml(client, root, priv->root, NULL, priv->menuproxy);


Follow ups