From 878db87fc09327b2116ecc291dde8595396dd19e Mon Sep 17 00:00:00 2001 From: Kinsey Moore Date: Mon, 21 Jul 2014 17:03:58 +0000 Subject: [PATCH] Dial API: Prevent crash on NULL cap This prevents a crash in the Dial API triggered by use of the Page() application where a format capability struct was used before checking whether it was NULL. ASTERISK-24074 #close git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419111 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- main/dial.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/dial.c b/main/dial.c index 0955aad049..afee5eeca6 100644 --- a/main/dial.c +++ b/main/dial.c @@ -300,7 +300,7 @@ static int begin_dial_prerun(struct ast_dial_channel *channel, struct ast_channe /* Copy device string over */ ast_copy_string(numsubst, channel->device, sizeof(numsubst)); - if (ast_format_cap_count(cap)) { + if (cap && ast_format_cap_count(cap)) { cap_request = cap; } else if (chan) { cap_request = ast_channel_nativeformats(chan); -- 2.47.2