adium.1-4: c03d69f8: applied changes from 29484df15413fe3bbd2...

thijsalkemade at gmail.com thijsalkemade at gmail.com
Sat Aug 20 14:06:08 EDT 2011


----------------------------------------------------------------------
Revision: c03d69f8e866e1e33d6cb47455b2c5ff0c9e1e7f
Parent:   a2a7d22793c162ec9187e9cc42dc2d90b7d5eeb0
Author:   thijsalkemade at gmail.com
Date:     08/20/11 13:56:57
Branch:   im.pidgin.adium.1-4
URL: http://d.pidgin.im/viewmtn/revision/info/c03d69f8e866e1e33d6cb47455b2c5ff0c9e1e7f

Changelog: 

applied changes from 29484df15413fe3bbd21bbfcef26a55362055a81
             through 5749f9193063800d27bef75c2388f6f9cc2f7f37

applied changes from 5749f9193063800d27bef75c2388f6f9cc2f7f37
             through 5c2dba4a7e2e76b76e7f472b88953a4316706d43
*** Plucked rev 5c2dba4a7e2e76b76e7f472b88953a4316706d43 (markdoliner at pidgin.im):
Fix a crash when remote users have certain characters in their
nicknames. (Discovered by Djego Ibanez)
Fixes #14341

Changes against parent a2a7d22793c162ec9187e9cc42dc2d90b7d5eeb0

  patched  libpurple/protocols/irc/msgs.c
  patched  libpurple/protocols/irc/parse.c

-------------- next part --------------
============================================================
--- libpurple/protocols/irc/msgs.c	58a11bfdfa8d0e944ca399e095ec92f999244623
+++ libpurple/protocols/irc/msgs.c	7a91c3c7cdb2f5ec3fb5856b26295f6365a88a96
@@ -409,14 +409,21 @@ void irc_msg_who(struct irc_conn *irc, c
 		PurpleConvChat *chat;
 		PurpleConvChatBuddy *cb;
 		
-		char *userhost, *realname;
+		char *cur, *userhost, *realname;
 		
 		PurpleConvChatBuddyFlags flags;
 		GList *keys = NULL, *values = NULL;
-		
+
+		if (!args || !args[0] || !args[1] || !args[2] || !args[3]
+		    || !args[4] || !args[5] || !args[6] || !args[7]) {
+			purple_debug(PURPLE_DEBUG_ERROR, "irc",
+				     "Got a WHO response with not enough arguments\n");
+			return;
+		}
+
 		conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_CHAT, args[1], irc->account);
 		if (!conv) {
-			purple_debug(PURPLE_DEBUG_ERROR, "irc", "Got a WHO response for %s, which doesn't exist\n", args[1]);
+			purple_debug(PURPLE_DEBUG_ERROR, "irc","Got a WHO response for %s, which doesn't exist\n", args[1]);
 			return;
 		}
 
@@ -429,7 +436,16 @@ void irc_msg_who(struct irc_conn *irc, c
 		chat = PURPLE_CONV_CHAT(conv);
 		
 		userhost = g_strdup_printf("%s@%s", args[2], args[3]);
-		realname = g_strdup(args[8]);
+
+		/* The final argument is a :-argument, but annoyingly
+		 * contains two "words", the hop count and real name. */
+		for (cur = args[7]; *cur; cur++) {
+			if (*cur == ' ') {
+				cur++;
+				break;
+			}
+		}
+		realname = g_strdup(cur);
 		
 		keys = g_list_prepend(keys, "userhost");
 		values = g_list_prepend(values, userhost);
============================================================
--- libpurple/protocols/irc/parse.c	7ba5e0c60a470adb5b676d9101bd56b8ebc11e74
+++ libpurple/protocols/irc/parse.c	594e4f458fd4f437a515b4c7da5bb2a794cd9542
@@ -65,7 +65,7 @@ static struct _irc_msg {
 	{ "319", "nn:", irc_msg_whois },	/* Whois channels		*/
 	{ "320", "nn:", irc_msg_whois },	/* Whois (fn ident)		*/
 	{ "314", "nnnvv:", irc_msg_whois },	/* Whowas user			*/
-	{ "315", "nt:", irc_msg_who }, /* end of WHO channel */
+	{ "315", "nt:", irc_msg_who },      /* end of WHO channel   */
 	{ "369", "nt:", irc_msg_endwhois },	/* End of WHOWAS		*/
 	{ "321", "*", irc_msg_list },		/* Start of list		*/
 	{ "322", "ncv:", irc_msg_list },	/* List.			*/
@@ -74,7 +74,7 @@ static struct _irc_msg {
 	{ "331", "nc:",	irc_msg_topic },	/* No channel topic		*/
 	{ "332", "nc:", irc_msg_topic },	/* Channel topic		*/
 	{ "333", "*", irc_msg_ignore },		/* Topic setter stuff		*/
-	{ "352", "nvcvnvvv:", irc_msg_who },	/* Channel WHO			*/
+	{ "352", "ncvvvnv:", irc_msg_who },	/* Channel WHO			*/
 	{ "353", "nvc:", irc_msg_names },	/* Names list			*/
 	{ "366", "nc:", irc_msg_names },	/* End of names			*/
 	{ "367", "ncnnv", irc_msg_ban },	/* Ban list			*/


More information about the Commits mailing list