changeset 28176:00302e68c31d

Fix parsing of invalid IRC TOPIC messages which contain no actual topic string. Thanks to Cristofaro Mune for finding this.
author Ethan Blanton <elb@pidgin.im>
date Thu, 03 Sep 2009 16:05:01 +0000
parents 558ce0b09e0e
children 5a1d215211e2
files ChangeLog libpurple/protocols/irc/msgs.c
diffstat 2 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Sep 03 16:03:39 2009 +0000
+++ b/ChangeLog	Thu Sep 03 16:05:01 2009 +0000
@@ -6,6 +6,9 @@
 	  to just making the warning non-fatal.
 	* Fix using GNOME proxy settings properly.  (Erik van Pienbroek)
 
+	IRC:
+	* Fix parsing of invalid TOPIC messages.
+
 	MSN:
 	* Sending custom smileys in chats is now supported.
 	* Ink messages are now saved when using the HTML logger.
--- a/libpurple/protocols/irc/msgs.c	Thu Sep 03 16:03:39 2009 +0000
+++ b/libpurple/protocols/irc/msgs.c	Thu Sep 03 16:05:01 2009 +0000
@@ -445,9 +445,13 @@
 	PurpleConversation *convo;
 
 	if (!strcmp(name, "topic")) {
+		if (!args[0] || !args[1])
+			return;
 		chan = args[0];
 		topic = irc_mirc2txt (args[1]);
 	} else {
+		if (!args[0] || !args[1] || !args[2])
+			return
 		chan = args[1];
 		topic = irc_mirc2txt (args[2]);
 	}