From: Alexander Traud Date: Fri, 13 Oct 2017 13:12:07 +0000 (+0200) Subject: tcptls: NULL-check the parameter of ast_ssl_teardown before accessing it. X-Git-Tag: 13.19.0-rc1~209^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=114ed320eae5f5fa111adc4ecd5ccd8f1b3537d0;p=thirdparty%2Fasterisk.git 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 --- diff --git a/main/tcptls.c b/main/tcptls.c index 820a03eaf0..e8ce2ce649 100644 --- a/main/tcptls.c +++ b/main/tcptls.c @@ -1047,7 +1047,7 @@ int ast_ssl_setup(struct ast_tls_config *cfg) 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; }