Skip to content
This repository was archived by the owner on Oct 29, 2021. It is now read-only.

Commit 73e3487

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 949b067 + 3e95806 commit 73e3487

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/conn.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,8 +435,8 @@ int xmpp_connect_client(xmpp_conn_t * const conn,
435435
resolver_srv_rr_t *srv_rr_list = NULL;
436436
resolver_srv_rr_t *rr;
437437
char *domain;
438-
const char *host;
439-
unsigned short port;
438+
const char *host = NULL;
439+
unsigned short port = 0;
440440
int found = XMPP_DOMAIN_NOT_FOUND;
441441
int rc;
442442

@@ -1192,6 +1192,7 @@ static int _conn_connect(xmpp_conn_t * const conn,
11921192

11931193
if (conn->state != XMPP_STATE_DISCONNECTED) return XMPP_EINVOP;
11941194
if (type != XMPP_CLIENT && type != XMPP_COMPONENT) return XMPP_EINVOP;
1195+
if (host == NULL || port == 0) return XMPP_EINT;
11951196

11961197
_conn_reset(conn);
11971198

tests/test_string.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static int test_strtok_r(void)
5858
static int test_strdup_one(xmpp_ctx_t *ctx, const char *s)
5959
{
6060
char *s1, *s2;
61-
int rc;
61+
int rc = 0;
6262

6363
s1 = strdup(s);
6464
s2 = xmpp_strdup(ctx, s);

0 commit comments

Comments
 (0)