pidgin: 1966ed86: jabber: Check at connection time that th...

darkrain42 at pidgin.im darkrain42 at pidgin.im
Sat Apr 10 15:45:53 EDT 2010


-----------------------------------------------------------------
Revision: 1966ed867201dcd9307580f8b67ae7c8cbff5b19
Ancestor: c19fc4797c75b50e6ca495a3059e82c7d8141133
Author: darkrain42 at pidgin.im
Date: 2010-04-10T19:43:04
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/1966ed867201dcd9307580f8b67ae7c8cbff5b19

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

ChangeLog: 

jabber: Check at connection time that the user specified a JID with a node.

This was reported by Florian Qu?ze 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").

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/jabber.c	b09411d87fd0ab1a6a4546abcd8038d2ff08ee40
+++ libpurple/protocols/jabber/jabber.c	d56ef492a23d67d7a38a236838f1daead64eadab
@@ -844,6 +844,14 @@ jabber_stream_new(PurpleAccount *account
 		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,


More information about the Commits mailing list