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

Joshua Colp asteriskteam at digium.com
Fri Mar 24 09:54:31 CDT 2017


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

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:
  Kevin Harwell: Looks good to me, but someone else must approve
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, approved



diff --git a/res/res_xmpp.c b/res/res_xmpp.c
index 32e1dd1..a6dfb9f 100644
--- a/res/res_xmpp.c
+++ b/res/res_xmpp.c
@@ -2672,7 +2672,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/5297
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifbf882896e598703b6c615407fa456d3199f95b1
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 14
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>



More information about the asterisk-code-review mailing list