changeset 26300:9aa672807759

merge of '99d00e3331645ef61bc0f08255d51234daaf67f5' and 'c7434c065403708c78a862aacde8febcaff8077a'
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Thu, 26 Mar 2009 05:34:15 +0000
parents de48f984f6e7 (current diff) 9f84925079d5 (diff)
children ba1799f21383 1a701a4ceae3
files
diffstat 2 files changed, 11 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/bonjour/mdns_win32.c	Thu Mar 26 05:29:18 2009 +0000
+++ b/libpurple/protocols/bonjour/mdns_win32.c	Thu Mar 26 05:34:15 2009 +0000
@@ -169,14 +169,17 @@
 	gboolean delete_buddy = FALSE;
 	PurpleBuddy *pb = NULL;
 
+	if ((pb = purple_find_buddy(args->account, args->res_data->name))) {
+		if (pb->proto_data != args->bb) {
+			purple_debug_error("bonjour", "Found purple buddy for %s not matching bonjour buddy record.",
+				args->res_data->name);
+			goto cleanup;
+		}
 	/* Make sure that the BonjourBuddy associated with this request is still around */
-	if (g_slist_find(pending_buddies, args->bb) == NULL)
+	} else if (g_slist_find(pending_buddies, args->bb) == NULL) {
+		purple_debug_error("bonjour", "host resolution - complete, but buddy no longer pending.\n");
 		goto cleanup;
-
-	if ((pb = purple_find_buddy(args->account, args->bb->name)))
-		if (pb->proto_data != args->bb)
-			purple_debug_error("bonjour", "Found purple buddy for %s not matching bonjour buddy record. "
-				"This is going to be ugly!.\n", args->bb->name);
+	}
 
 	if (!hosts || !hosts->data) {
 		purple_debug_error("bonjour", "host resolution - callback error.\n");
--- a/libpurple/protocols/yahoo/yahoo_packet.c	Thu Mar 26 05:29:18 2009 +0000
+++ b/libpurple/protocols/yahoo/yahoo_packet.c	Thu Mar 26 05:34:15 2009 +0000
@@ -201,6 +201,8 @@
 		}
 		pos += 2;
 
+		if (pos + 1 > len) break;
+
 		/* Skip over garbage we've noticed in the mail notifications */
 		if (data[0] == '9' && data[pos] == 0x01)
 			pos++;