[Asterisk-code-review] tcptls: NULL-check the parameter of ast ssl teardown before ... (asterisk[14])

Alexander Traud asteriskteam at digium.com
Fri Oct 13 08:15:05 CDT 2017


Alexander Traud has uploaded this change for review. ( https://gerrit.asterisk.org/6790


Change subject: tcptls: NULL-check the parameter of ast_ssl_teardown before accessing it.
......................................................................

tcptls: NULL-check the parameter of ast_ssl_teardown before accessing it.

This avoids a crash on stopping a chan_sip which failed to start its TLS server.

ASTERISK-27339 #close

Change-Id: I327fc70db68eaaca5b50a15c7fd687fde79263d5
---
M main/tcptls.c
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/90/6790/1

diff --git a/main/tcptls.c b/main/tcptls.c
index e237dc7..025cb15 100644
--- a/main/tcptls.c
+++ b/main/tcptls.c
@@ -1075,7 +1075,7 @@
 void ast_ssl_teardown(struct ast_tls_config *cfg)
 {
 #ifdef DO_SSL
-	if (cfg->ssl_ctx) {
+	if (cfg && cfg->ssl_ctx) {
 		SSL_CTX_free(cfg->ssl_ctx);
 		cfg->ssl_ctx = NULL;
 	}

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

Gerrit-Project: asterisk
Gerrit-Branch: 14
Gerrit-MessageType: newchange
Gerrit-Change-Id: I327fc70db68eaaca5b50a15c7fd687fde79263d5
Gerrit-Change-Number: 6790
Gerrit-PatchSet: 1
Gerrit-Owner: Alexander Traud <pabstraud at compuserve.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171013/ddf42668/attachment-0001.html>


More information about the asterisk-code-review mailing list