mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
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
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user