From: Richard Mudgett Date: Fri, 2 Sep 2016 16:36:38 +0000 (-0500) Subject: format_cap.c: Fix CLI "core show channeltype Surrogate" crash. X-Git-Tag: 14.1.0-rc1~84^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2a8d27e020bf19ee843e2a7db358f8fc0d8172f9;p=thirdparty%2Fasterisk.git 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 --- diff --git a/main/format_cap.c b/main/format_cap.c index 2b3e6cd5f8..013b7bea1b 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); }