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:54:12 -0500 |
commit | 8d1c535bd66349edfa8e974866eba632e3ba4e95 (patch) | |
tree | 5e170efe26d65488aef9c68ea5fdf68df8c1cbef /main | |
parent | 1bd571ef75900c78f98b047659de9d2d6c0c51b5 (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')
-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 bf3bd1c4b..5d8a6e585 100644 --- a/main/format_cap.c +++ b/main/format_cap.c @@ -737,7 +737,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); } |