]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res_xmpp: Correctly check return value of SSL_connect
authorSean Bright <sean.bright@gmail.com>
Thu, 23 Mar 2017 14:30:18 +0000 (10:30 -0400)
committerSean Bright <sean.bright@gmail.com>
Thu, 23 Mar 2017 14:58:05 +0000 (08:58 -0600)
SSL_connect returns non-zero for both success and some error conditions
so simply negating is inadequate.

Change-Id: Ifbf882896e598703b6c615407fa456d3199f95b1

res/res_xmpp.c

index 1aa865cd6267f1e9818b6d2c60b2291de69a0d47..ddd4a5722cc12b39f926ee7a45d26af8a1c41c34 100644 (file)
@@ -2670,7 +2670,7 @@ static int xmpp_client_requested_tls(struct ast_xmpp_client *client, struct ast_
                goto failure;
        }
 
-       if (!SSL_connect(client->ssl_session)) {
+       if (SSL_connect(client->ssl_session) <= 0) {
                goto failure;
        }