From 1a655d515fea1f954e41e0abf756f21ad1c6058c Mon Sep 17 00:00:00 2001 From: Ralph Giles Date: Wed, 15 Jun 2005 17:15:43 +0000 Subject: [PATCH] Check for a valid resource to bind before checking its length. --- src/auth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/auth.c b/src/auth.c index bbcab34..14dc037 100644 --- a/src/auth.c +++ b/src/auth.c @@ -531,7 +531,7 @@ static int _handle_features_sasl(xmpp_conn_t * const conn, /* request a specific resource if we have one */ resource = xmpp_jid_resource(conn->ctx, conn->jid); - if (strlen(resource) == 0) { + if ((resource != NULL) && (strlen(resource) == 0)) { /* j2 doesn't handle an empty resource */ xmpp_free(conn->ctx, resource); resource = NULL;