diff options
author | Richard Mudgett <rmudgett@digium.com> | 2016-09-02 11:36:38 -0500 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2016-09-02 12:56:21 -0500 |
commit | c3b965a2c03d132d9feb91928bd72b283406f948 (patch) | |
tree | bcf1c13e45962143645ac706e2c1789224ac135d /main/format_cap.c | |
parent | d3c4b901d476a41b3f7df063aeba3852df4e26b7 (diff) |
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
Diffstat (limited to 'main/format_cap.c')
-rw-r--r-- | main/format_cap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/main/format_cap.c b/main/format_cap.c index 2b3e6cd5f..013b7bea1 100644 --- a/main/format_cap.c +++ b/main/format_cap.c @@ -703,7 +703,7 @@ const char *ast_format_cap_get_names(struct ast_format_cap *cap, struct ast_str 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); } |