Mercurial > pidgin
diff libpurple/protocols/jabber/jingle.c @ 23833:ee028c73d3e2
Fix crash when receiving a session-initiate ack for a nonexistent session.
author | Mike Ruprecht <maiku@soc.pidgin.im> |
---|---|
date | Sat, 07 Jun 2008 20:16:06 +0000 |
parents | bdc09d3164df |
children | c2231cf3be71 |
line wrap: on
line diff
--- a/libpurple/protocols/jabber/jingle.c Sat Jun 07 19:57:32 2008 +0000 +++ b/libpurple/protocols/jabber/jingle.c Sat Jun 07 20:16:06 2008 +0000 @@ -992,9 +992,18 @@ { const char *from = xmlnode_get_attrib(packet, "from"); JingleSession *session = jabber_jingle_session_find_by_jid(js, from); - PurpleMedia *media = session->media; + PurpleMedia *media; GList *contents; + if (!session) { + /* respond with an error here */ + purple_debug_error("jingle", "Received session-initiate ack" + " to nonexistent session\n"); + return; + } + + media = session->media; + if (!strcmp(xmlnode_get_attrib(packet, "type"), "error")) { purple_media_got_hangup(media); return;