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

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


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


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/88/6788/1

diff --git a/main/tcptls.c b/main/tcptls.c
index dbcff9d..a25e25b 100644
--- a/main/tcptls.c
+++ b/main/tcptls.c
@@ -500,7 +500,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/6788
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I327fc70db68eaaca5b50a15c7fd687fde79263d5
Gerrit-Change-Number: 6788
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/f6412531/attachment.html>


More information about the asterisk-code-review mailing list