conn: fix segfault in xmpp_connect_client() when jid not set

This commit is contained in:
Dmitry Podgorny
2021-03-23 02:12:55 +02:00
parent 588aea4f54
commit e77cd53215

View File

@@ -542,6 +542,11 @@ int xmpp_connect_client(xmpp_conn_t *conn,
conn->jid);
}
if (!conn->jid) {
xmpp_error(conn->ctx, "xmpp", "JID is not set.");
return XMPP_EINVOP;
}
domain = xmpp_jid_domain(conn->ctx, conn->jid);
if (!domain)
return XMPP_EMEM;