diff libpurple/protocols/irc/msgs.c @ 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 f9cf1e14838b
children 0357ae320ba5
line wrap: on
line diff
--- 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]);
 	}