]> git.0d.be Git - empathy.git/commitdiff
Check we actually have a part #1 before requesting it
authorDanielle Madeley <danielle.madeley@collabora.co.uk>
Wed, 8 Jun 2011 02:54:41 +0000 (12:54 +1000)
committerDanielle Madeley <danielle.madeley@collabora.co.uk>
Wed, 8 Jun 2011 12:00:49 +0000 (22:00 +1000)
We were checking echo->len >= 1, but then requesting index 1 (the second part).
So if we didn't have a second part, this would quite happily blow up.

libempathy/empathy-tp-chat.c

index 5d4ce26f7f3b14cf00c8bce3df42d73045b8d329..63b1e87d662a79e3f8e7e296e14422afd220b07c 100644 (file)
@@ -376,7 +376,7 @@ handle_delivery_report (EmpathyTpChat *self,
         * TpMessage. (fdo #35884) */
        echo = tp_asv_get_boxed (header, "delivery-echo",
                TP_ARRAY_TYPE_MESSAGE_PART_LIST);
-       if (echo != NULL && echo->len >= 1) {
+       if (echo != NULL && echo->len >= 2) {
                const GHashTable *echo_body;
 
                echo_body = g_ptr_array_index (echo, 1);