Mercurial > pidgin.yaz
comparison libpurple/protocols/jabber/jingle/transport.c @ 31556:4b101cad58e7
Don't crash on invalid/unexpected jingle transport types. Fixes #13136.
committer: John Bailey <rekkanoryo@rekkanoryo.org>
author | nikita@beem-project.com |
---|---|
date | Sat, 08 Jan 2011 02:58:06 +0000 |
parents | a8cc50c2279f |
children | c9da7f5fbd0e |
comparison
equal
deleted
inserted
replaced
31555:4f89666c8d81 | 31556:4b101cad58e7 |
---|---|
157 } | 157 } |
158 | 158 |
159 JingleTransport * | 159 JingleTransport * |
160 jingle_transport_parse(xmlnode *transport) | 160 jingle_transport_parse(xmlnode *transport) |
161 { | 161 { |
162 const gchar *type = xmlnode_get_namespace(transport); | 162 const gchar *type_name = xmlnode_get_namespace(transport); |
163 return JINGLE_TRANSPORT_CLASS(g_type_class_ref(jingle_get_type(type)))->parse(transport); | 163 GType type = jingle_get_type(type_name); |
164 if (type == G_TYPE_NONE) | |
165 return NULL; | |
166 | |
167 return JINGLE_TRANSPORT_CLASS(g_type_class_ref(type))->parse(transport); | |
164 } | 168 } |
165 | 169 |
166 xmlnode * | 170 xmlnode * |
167 jingle_transport_to_xml(JingleTransport *transport, xmlnode *content, JingleActionType action) | 171 jingle_transport_to_xml(JingleTransport *transport, xmlnode *content, JingleActionType action) |
168 { | 172 { |