]> git.ipfire.org Git - thirdparty/asterisk.git/commit
main/dial: Protect access to the format_cap structure of the requesting channel 67/1567/1
authorMatt Jordan <mjordan@digium.com>
Wed, 4 Nov 2015 20:31:28 +0000 (14:31 -0600)
committerMatt Jordan <mjordan@digium.com>
Wed, 4 Nov 2015 20:42:26 +0000 (15:42 -0500)
commit385e26efe24070bfdb654ef5aa44797a290a45d3
tree6fb685ce6026f7cabc6ed5c306cddb8a17c2f7f6
parent62799fe778aa21e19eaef97997732c437ff6f7ed
main/dial: Protect access to the format_cap structure of the requesting channel

When a dial attempt is made that involves a requesting channel, we previously
were not:
a) Protecting access to the native format capabilities structure on the
   requesting channel. That is inherently unsafe.
b) Reference bumping the lifetime of the format capabilities structure.

In both cases, something else could sneak in, blow away the format
capabilities, and we'd be holding onto an invalid format_cap structure. When
the newly created channel attempts to construct its format capabilities, things
go poorly.

This patch:
a) Ensures that we get a reference to the native format capabilities while
   the requesting channel is locked
b) Holds a reference to the native format capabilities during the creation
   of the new channel.

ASTERISK-25522 #close

Change-Id: I0bfb7ba8b9711f4158cbeaae96edf9626e88a54f
main/dial.c