changeset 29696:08957bb38e30

jabber: Check at connection time that the user specified a JID with a node. This was reported by Florian Quze as http://crash-stats.instantbird.com/report/index/6747f742-f02e-4ccf-8214-0ad152100325. The only way I can see that happening is if jid->node is NULL (i.e. my account username is something like "darkrain42.org").
author Paul Aurich <paul@darkrain42.org>
date Sat, 10 Apr 2010 19:43:04 +0000
parents ab168cf2713e
children 258454cfecee
files libpurple/protocols/jabber/jabber.c
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/jabber.c	Sat Apr 10 18:28:45 2010 +0000
+++ b/libpurple/protocols/jabber/jabber.c	Sat Apr 10 19:43:04 2010 +0000
@@ -844,6 +844,14 @@
 		return NULL;
 	}
 
+	if (!js->user->node || *(js->user->node) == '\0') {
+		purple_connection_error_reason(gc,
+			PURPLE_CONNECTION_ERROR_INVALID_SETTINGS,
+			_("Invalid XMPP ID. Username portion must be set."));
+		/* Destroying the connection will free the JabberStream */
+		return NULL;
+	}
+
 	if (!js->user->domain || *(js->user->domain) == '\0') {
 		purple_connection_error_reason(gc,
 			PURPLE_CONNECTION_ERROR_INVALID_SETTINGS,