[empathy] Check we actually have a part #1 before requesting it



commit e5773f0b667fabbf0597ab2c3600164fc018c727
Author: Danielle Madeley <danielle madeley collabora co uk>
Date:   Wed Jun 8 12:54:41 2011 +1000

    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 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/libempathy/empathy-tp-chat.c b/libempathy/empathy-tp-chat.c
index 5d4ce26..63b1e87 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);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]