[Asterisk-code-review] format cap.c: Fix CLI "core show channeltype Surrogate" crash. (asterisk[13])

Anonymous Coward asteriskteam at digium.com
Tue Sep 6 09:00:10 CDT 2016


Anonymous Coward #1000019 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
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, but someone else must approve



diff --git a/main/format_cap.c b/main/format_cap.c
index bf3bd1c..5d8a6e5 100644
--- a/main/format_cap.c
+++ b/main/format_cap.c
@@ -737,7 +737,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/3786
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Id67e93936dc8ec2a33a9d33655843d43b59285a3
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
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-code-review mailing list