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

Jenkins2 asteriskteam at digium.com
Thu May 11 10:35:05 CDT 2017


Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/5583 )

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/manager.c
1 file changed, 8 insertions(+), 0 deletions(-)

Approvals:
  George Joseph: Looks good to me, approved; Verified
  Jenkins2: Approved for Submit
  Joshua Colp: Looks good to me, but someone else must approve



diff --git a/main/manager.c b/main/manager.c
index 0ea6bfa..6f57f05 100644
--- a/main/manager.c
+++ b/main/manager.c
@@ -8723,6 +8723,10 @@
 	ami_tls_cfg.pvtfile = NULL;
 	ast_free(ami_tls_cfg.cipher);
 	ami_tls_cfg.cipher = NULL;
+	ast_free(ami_tls_cfg.cafile);
+	ami_tls_cfg.cafile = NULL;
+	ast_free(ami_tls_cfg.capath);
+	ami_tls_cfg.capath = NULL;
 
 	ao2_global_obj_release(mgr_sessions);
 
@@ -8823,6 +8827,10 @@
 	ami_tls_cfg.pvtfile = ast_strdup("");
 	ast_free(ami_tls_cfg.cipher);
 	ami_tls_cfg.cipher = ast_strdup("");
+	ast_free(ami_tls_cfg.cafile);
+	ami_tls_cfg.cafile = ast_strdup("");
+	ast_free(ami_tls_cfg.capath);
+	ami_tls_cfg.capath = ast_strdup("");
 }
 
 static int __init_manager(int reload, int by_external_config)

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I63ff715d9d9023427543a5b8a4ba7b0d82533c12
Gerrit-PatchSet: 3
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Joshua Elson <joshelson at gmail.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Joshua Elson <joshelson at gmail.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>



More information about the asterisk-code-review mailing list