[Asterisk-code-review] Prevent Undefined Capath Crash (asterisk[14])

Joshua Elson asteriskteam at digium.com
Thu May 4 17:37:11 CDT 2017


Joshua Elson has uploaded a new change for review. ( https://gerrit.asterisk.org/5584 )

Change subject: Prevent Undefined Capath Crash
......................................................................

Prevent Undefined Capath Crash

It is possible to initialize a valid config without a capath
or cafile definition. This will cause a crash on a reload.

This fix ensures capath is always allocated.

ASTERISK-26983 #close

Change-Id: I63ff715d9d9023427543a5b8a4ba7b0d82533c12
---
M main/tcptls.c
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/84/5584/1

diff --git a/main/tcptls.c b/main/tcptls.c
index 999c872..b547c9c 100644
--- a/main/tcptls.c
+++ b/main/tcptls.c
@@ -974,6 +974,8 @@
 		if (SSL_CTX_load_verify_locations(cfg->ssl_ctx, S_OR(cfg->cafile, NULL), S_OR(cfg->capath,NULL)) == 0) {
 			ast_log(LOG_ERROR, "TLS/SSL CA file(%s)/path(%s) error\n", cfg->cafile, cfg->capath);
 		}
+	} else {
+		cfg->capath = NULL;
 	}
 
 #ifdef HAVE_OPENSSL_EC

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I63ff715d9d9023427543a5b8a4ba7b0d82533c12
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 14
Gerrit-Owner: Joshua Elson <joshelson at gmail.com>



More information about the asterisk-code-review mailing list