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

Sean Bright asteriskteam at digium.com
Thu Mar 23 09:57:57 CDT 2017


Sean Bright has uploaded a new change for review. ( 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(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/97/5297/1

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: newchange
Gerrit-Change-Id: Ifbf882896e598703b6c615407fa456d3199f95b1
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 14
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>



More information about the asterisk-code-review mailing list