diff options
author | Marcus Lundblad <malu@pidgin.im> | 2009-04-22 18:37:23 +0000 |
---|---|---|
committer | Marcus Lundblad <malu@pidgin.im> | 2009-04-22 18:37:23 +0000 |
commit | ae54c5d56a22145185785c775a854cf1a228daa0 (patch) | |
tree | 13954922b56d464883426632430584c41a807a6b | |
parent | 8f37d0dc0f4d5287ad6b964364244e3822cef871 (diff) | |
download | pidgin-ae54c5d56a22145185785c775a854cf1a228daa0.tar.gz |
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).
-rw-r--r-- | libpurple/protocols/jabber/jingle/content.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libpurple/protocols/jabber/jingle/content.c b/libpurple/protocols/jabber/jingle/content.c index 3b83e7fe86..e3d06c9662 100644 --- a/libpurple/protocols/jabber/jingle/content.c +++ b/libpurple/protocols/jabber/jingle/content.c @@ -391,7 +391,13 @@ JingleContent * 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 * |