[asterisk-commits] format cap.c: Fix CLI "core show channeltype Surrogate" crash. (asterisk[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Sep 6 10:06:10 CDT 2016


Joshua Colp has submitted this change and it was merged.

Change subject: format_cap.c: Fix CLI "core show channeltype Surrogate" crash.
......................................................................


format_cap.c: Fix CLI "core show channeltype Surrogate" crash.

* Make ast_format_cap_get_names() NULL tolerant.

ASTERISK-26331 #close
Reported by: CGI.NET

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

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



diff --git a/main/format_cap.c b/main/format_cap.c
index 2b3e6cd..013b7be 100644
--- a/main/format_cap.c
+++ b/main/format_cap.c
@@ -703,7 +703,7 @@
 
 	ast_str_set(buf, 0, "(");
 
-	if (!AST_VECTOR_SIZE(&cap->preference_order)) {
+	if (!cap || !AST_VECTOR_SIZE(&cap->preference_order)) {
 		ast_str_append(buf, 0, "nothing)");
 		return ast_str_buffer(*buf);
 	}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id67e93936dc8ec2a33a9d33655843d43b59285a3
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>



More information about the asterisk-commits mailing list