diff options
| author | Jelmer Vernooij <jelmer@samba.org> | 2005-12-15 13:24:25 +0100 | 
|---|---|---|
| committer | Jelmer Vernooij <jelmer@samba.org> | 2005-12-15 13:24:25 +0100 | 
| commit | bd69a219c0a618354fd80a98dd0d9a04fee755e0 (patch) | |
| tree | b4477537e48c6d7b2e5a261aa860a0688d69fb66 /protocols/jabber/jabber.c | |
| parent | 2983f5e8c2d3046bf01337e5caefa3af55ba6bff (diff) | |
| parent | bf02a679c61b0f030ee8f2f01698699a7775f7d5 (diff) | |
Merge Wilmer
Diffstat (limited to 'protocols/jabber/jabber.c')
| -rw-r--r-- | protocols/jabber/jabber.c | 21 | 
1 files changed, 12 insertions, 9 deletions
| diff --git a/protocols/jabber/jabber.c b/protocols/jabber/jabber.c index 413f77ef..fc419124 100644 --- a/protocols/jabber/jabber.c +++ b/protocols/jabber/jabber.c @@ -21,10 +21,6 @@   *   */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -  #ifndef _WIN32  #include <sys/utsname.h>  #endif @@ -58,6 +54,8 @@  #define DEFAULT_GROUPCHAT "conference.jabber.org"  #define DEFAULT_PORT 5222  #define DEFAULT_PORT_SSL 5223 +#define JABBER_PORT_MIN 5220 +#define JABBER_PORT_MAX 5229  #define JABBER_GROUP "Friends" @@ -540,11 +538,6 @@ static void gjab_connected_ssl(gpointer data, void *source, GaimInputCondition c  	struct jabber_data *jd;  	gjconn gjc; -	if (!g_slist_find(get_connections(), gc)) { -		ssl_disconnect(source); -		return; -	} -	  	jd = gc->proto_data;  	gjc = jd->gjc; @@ -553,6 +546,11 @@ static void gjab_connected_ssl(gpointer data, void *source, GaimInputCondition c  		return;  	} +	if (!g_slist_find(get_connections(), gc)) { +		ssl_disconnect(source); +		return; +	} +	  	gjab_connected(data, gjc->fd, cond);  } @@ -588,6 +586,11 @@ static void gjab_start(gjconn gjc)  		port = DEFAULT_PORT;  	else if (port == -1 && ssl)  		port = DEFAULT_PORT_SSL; +	else if (port < JABBER_PORT_MIN || port > JABBER_PORT_MAX) { +		serv_got_crap(GJ_GC(gjc), "For security reasons, the Jabber port number must be in the %d-%d range.", JABBER_PORT_MIN, JABBER_PORT_MAX); +		STATE_EVT(JCONN_STATE_OFF) +		return; +	}  	if (server == NULL)  		server = g_strdup(gjc->user->server); | 
