pidgin.next.minor: 0f644861: Fix a crash in this branch that I introd...

markdoliner at pidgin.im markdoliner at pidgin.im
Wed Jan 28 02:15:43 EST 2009


-----------------------------------------------------------------
Revision: 0f6448611cd49bf03cc4646ca0fa7e8d0fd8bea0
Ancestor: 5da8947a38c8e1b99e31f469da81fd097dc18827
Author: markdoliner at pidgin.im
Date: 2009-01-28T07:12:43
Branch: im.pidgin.pidgin.next.minor
URL: http://d.pidgin.im/viewmtn/revision/info/0f6448611cd49bf03cc4646ca0fa7e8d0fd8bea0

Modified files:
        libpurple/protocols/oscar/oscar.c

ChangeLog: 

Fix a crash in this branch that I introduced a few days ago.  bname
was null here because it got initialized at a time when b was null.

-------------- next part --------------
============================================================
--- libpurple/protocols/oscar/oscar.c	da8cb960c169f8da0554e7b4e40cd9ef943e8b90
+++ libpurple/protocols/oscar/oscar.c	006bfced3ac5b368ba611f95cd554e24313a72ca
@@ -807,13 +807,11 @@ static void oscar_user_info_append_statu
 	PurpleStatus *status = NULL;
 	gchar *message = NULL, *itmsurl = NULL, *tmp;
 	gboolean is_away;
-	const char *bname;
 
 	od = purple_connection_get_protocol_data(gc);
 
-	bname = purple_buddy_get_name(b);
 	if (userinfo == NULL)
-		userinfo = aim_locate_finduserinfo(od, bname);
+		userinfo = aim_locate_finduserinfo(od, purple_buddy_get_name(b));
 
 	if ((user_info == NULL) || ((b == NULL) && (userinfo == NULL)))
 		return;
@@ -886,7 +884,7 @@ static void oscar_user_info_append_statu
 
 	if (b) {
 		if (purple_presence_is_online(presence)) {
-			if (oscar_util_valid_name_icq(bname) || is_away || !message || !(*message)) {
+			if (oscar_util_valid_name_icq(purple_buddy_get_name(b)) || is_away || !message || !(*message)) {
 				/* Append the status name for online ICQ statuses, away AIM statuses, and for all buddies with no message.
 				 * If the status name and the message are the same, only show one. */
 				const char *status_name = purple_status_get_name(status);
@@ -901,21 +899,20 @@ static void oscar_user_info_append_statu
 				message = tmp;
 			}
 
+		} else if (aim_ssi_waitingforauth(od->ssi.local,
+			aim_ssi_itemlist_findparentname(od->ssi.local, purple_buddy_get_name(b)),
+			purple_buddy_get_name(b)))
+		{
+			/* Note if an offline buddy is not authorized */
+			tmp = g_strdup_printf("%s%s%s",
+					_("Not Authorized"),
+					(message && *message) ? ": " : "",
+					(message && *message) ? message : "");
+			g_free(message);
+			message = tmp;
 		} else {
-			if (aim_ssi_waitingforauth(od->ssi.local,
-									   aim_ssi_itemlist_findparentname(od->ssi.local, bname),
-									   bname)) {
-				/* Note if an offline buddy is not authorized */
-				tmp = g_strdup_printf("%s%s%s",
-									  _("Not Authorized"),
-									  (message && *message) ? ": " : "",
-									  (message && *message) ? message : "");
-				g_free(message);
-				message = tmp;
-			} else {
-				g_free(message);
-				message = g_strdup(_("Offline"));
-			}
+			g_free(message);
+			message = g_strdup(_("Offline"));
 		}
 
 	}


More information about the Commits mailing list