changeset 26620:7be72613e9ce

Actually reject content unknown content types on Jingle session-initiate, instead of crashing :) I found this while tinkering with Jingle FT, when it sent such an initiate (because of hashed caps, I believe).
author Marcus Lundblad <ml@update.uu.se>
date Wed, 22 Apr 2009 18:37:23 +0000
parents 4a18d518a572
children d06af7664a7a
files libpurple/protocols/jabber/jingle/content.c
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/jingle/content.c	Fri Apr 17 21:31:45 2009 +0000
+++ b/libpurple/protocols/jabber/jingle/content.c	Wed Apr 22 18:37:23 2009 +0000
@@ -391,7 +391,13 @@
 jingle_content_parse(xmlnode *content)
 {
 	const gchar *type = xmlnode_get_namespace(xmlnode_get_child(content, "description"));
-	return JINGLE_CONTENT_CLASS(g_type_class_ref(jingle_get_type(type)))->parse(content);
+	GType jingle_type = jingle_get_type(type);
+
+	if (jingle_type != G_TYPE_NONE) {
+		return JINGLE_CONTENT_CLASS(g_type_class_ref(jingle_type))->parse(content);
+	} else {
+		return NULL;
+	}
 }
 
 static xmlnode *