changeset 24697:08414e3d8b4f

Don't allow connecting a SIMPLE account if no server is configured. Fixes #7767. committer: John Bailey <rekkanoryo@rekkanoryo.org>
author Florian Quèze <florian@instantbird.org>
date Mon, 15 Dec 2008 03:54:39 +0000
parents 939d173b68b3
children d1da5c4c1e6b
files ChangeLog libpurple/protocols/simple/simple.c
diffstat 2 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Dec 15 03:01:38 2008 +0000
+++ b/ChangeLog	Mon Dec 15 03:54:39 2008 +0000
@@ -7,7 +7,6 @@
 	  notifications when the same buddy is in multiple groups (Florian Quèze)
 	* The Buddy State Notification plugin no longer turns JID's, MSN Passport
 	  ID's, etc. into links (Florian Quèze)
-	* Fix a crash in SIMPLE when a malformed message is received.
 	* purple-remote now has a "getstatusmessage" command to retrieve the text
 	  of the current status message.
 	* Various fixes to the nullprpl (Paul Aurich)
@@ -42,6 +41,11 @@
 	  correctly received.
 	* Many other fixes and code cleanup.
 
+	SIMPLE:
+	* Fix a crash when a malformed message is received.
+	* Don't allow connecting accounts if no server name has been specified
+	  (Florian Quèze)
+
 	XMPP:
 	* Fix the namespace URL we look for in PEP reply stanzas to match the URL
 	  used in the 'get' requests (Paul Aurich)
--- a/libpurple/protocols/simple/simple.c	Mon Dec 15 03:01:38 2008 +0000
+++ b/libpurple/protocols/simple/simple.c	Mon Dec 15 03:54:39 2008 +0000
@@ -1939,6 +1939,13 @@
 		sip->txbuf = purple_circ_buffer_new(0);
 
 	userserver = g_strsplit(username, "@", 2);
+	if (userserver[1] == NULL || userserver[1][0] == '\0') {
+		purple_connection_error_reason(gc,
+			PURPLE_CONNECTION_ERROR_INVALID_SETTINGS,
+			_("SIP connect server not specified"));
+		return;
+	}
+
 	purple_connection_set_display_name(gc, userserver[0]);
 	sip->username = g_strdup(userserver[0]);
 	sip->servername = g_strdup(userserver[1]);