[telepathy-gabble/master] Don't crash on unknown incoming Jingle actions.

Will Thompson will.thompson at collabora.co.uk
Tue Jun 2 08:59:01 PDT 2009


Previously, gabble_jingle_session_parse() called produce_action() (which
asserts if you pass it JINGLE_ACTION_UNKNOWN) before checking whether
the action is UNKNOWN, with hilarious consequences.

Fixes: fd.o#20807
---
 src/jingle-session.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/jingle-session.c b/src/jingle-session.c
index e34158a..9189078 100644
--- a/src/jingle-session.c
+++ b/src/jingle-session.c
@@ -1341,6 +1341,12 @@ gabble_jingle_session_parse (GabbleJingleSession *sess, JingleAction action, LmM
   /* IQ from/to can come in handy */
   from = lm_message_node_get_attribute (iq_node, "from");
 
+  if (action == JINGLE_ACTION_UNKNOWN)
+    {
+      SET_BAD_REQ ("unknown session action");
+      return FALSE;
+    }
+
   DEBUG ("jingle action '%s' from '%s' in session '%s' dialect %u state %u",
       produce_action (action, priv->dialect), from, priv->sid,
       priv->dialect, priv->state);
@@ -1370,12 +1376,6 @@ gabble_jingle_session_parse (GabbleJingleSession *sess, JingleAction action, LmM
       return FALSE;
     }
 
-  if (action == JINGLE_ACTION_UNKNOWN)
-    {
-      SET_BAD_REQ ("unknown session action");
-      return FALSE;
-    }
-
   initiator = lm_message_node_get_attribute (session_node, "initiator");
   if (initiator == NULL)
     {
-- 
1.5.6.5




More information about the telepathy-commits mailing list