From e5773f0b667fabbf0597ab2c3600164fc018c727 Mon Sep 17 00:00:00 2001 From: Danielle Madeley Date: Wed, 8 Jun 2011 12:54:41 +1000 Subject: Check we actually have a part #1 before requesting it 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libempathy/empathy-tp-chat.c b/libempathy/empathy-tp-chat.c index 5d4ce26f7..63b1e87d6 100644 --- a/libempathy/empathy-tp-chat.c +++ b/libempathy/empathy-tp-chat.c @@ -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); -- cgit v1.2.3