]> git.ipfire.org Git - thirdparty/asterisk.git/commit
bridge_channel_write_frame: Check for NULL channel
authorGeorge Joseph <gjoseph@digium.com>
Fri, 2 Apr 2021 12:21:33 +0000 (06:21 -0600)
committerFriendly Automation <jenkins2@gerrit.asterisk.org>
Mon, 5 Apr 2021 12:50:28 +0000 (07:50 -0500)
commit88aec107df0d22fe147155caed39fe83f35ad6c6
treebb0d2f7a74e2721ba8eff441eff1cf4d2d64f4a8
parent404533c149dd256903aa7a03400d8d85be6ad368
bridge_channel_write_frame: Check for NULL channel

There is a possibility, when bridge_channel_write_frame() is
called, that the bridge_channel->chan will be NULL.  The first
thing bridge_channel_write_frame() does though is call
ast_channel_is_multistream() which had no check for a NULL
channel and therefore caused a segfault. Since it's still
possible for bridge_channel_write_frame() to write the frame to
the other channels in the bridge, we don't want to bail before we
call ast_channel_is_multistream() but we can just skip the
multi-channel stuff.  So...

bridge_channel_write_frame() only calls ast_channel_is_multistream()
if bridge_channel->chan is not NULL.

As a safety measure, ast_channel_is_multistream() now returns
false if the supplied channel is NULL.

ASTERISK-29379
Reported-by: Vyrva Igor
Reported-by: Ross Beer
Change-Id: Idfe62dbea8c69813ecfd58e113a6620dc42352ce
main/bridge_channel.c
main/channel_internal_api.c