[Asterisk-code-review] res xmpp: Correctly check return value of SSL connect (asterisk[13])

Joshua Colp asteriskteam at digium.com
Tue Mar 28 18:04:13 CDT 2017


Joshua Colp has submitted this change and it was merged. ( https://gerrit.asterisk.org/5288 )

Change subject: res_xmpp: Correctly check return value of SSL_connect
......................................................................


res_xmpp: Correctly check return value of SSL_connect

SSL_connect returns non-zero for both success and some error conditions
so simply negating is inadequate.

Change-Id: Ifbf882896e598703b6c615407fa456d3199f95b1
---
M res/res_xmpp.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Anonymous Coward #1000019: Verified
  Matthew Fredrickson: Looks good to me, approved
  Joshua Colp: Looks good to me, but someone else must approve



diff --git a/res/res_xmpp.c b/res/res_xmpp.c
index e422c14..aee2cf5 100644
--- a/res/res_xmpp.c
+++ b/res/res_xmpp.c
@@ -2664,7 +2664,7 @@
 		goto failure;
 	}
 
-	if (!SSL_connect(client->ssl_session)) {
+	if (SSL_connect(client->ssl_session) <= 0) {
 		goto failure;
 	}
 

-- 
To view, visit https://gerrit.asterisk.org/5288
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifbf882896e598703b6c615407fa456d3199f95b1
Gerrit-PatchSet: 4
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Matthew Fredrickson <creslin at digium.com>



More information about the asterisk-code-review mailing list