]> git.ipfire.org Git - thirdparty/asterisk.git/commit
bridge_native_rtp.c: Fix native rtp bridge data race. 81/4681/1
authorRichard Mudgett <rmudgett@digium.com>
Fri, 23 Dec 2016 18:10:40 +0000 (12:10 -0600)
committerRichard Mudgett <rmudgett@digium.com>
Fri, 23 Dec 2016 20:14:56 +0000 (14:14 -0600)
commit92235dba88afc5170ac0f6d848116accb27adad2
tree996c5ac24a221ede9a4786666a6f56c9380b2cf9
parent1aaa6305088c5b4a517130b9d49da4bdfec69575
bridge_native_rtp.c: Fix native rtp bridge data race.

native_rtp_bridge_compatible() didn't lock the bridge channels before
checking the channels for native bridging ability.  As a result, one of
the channel's native format capabilities structure got replaced out from
under the native bridge check.  Use of a stale pointer to freed memory
causes bad things to happen.

MALLOC_DEBUG, DO_CRASH, and the
tests/channels/pjsip/transfers/blind_transfer/caller_direct_media
testsuite test caught this.

* Add missing channel locking in native_rtp_bridge_compatible().

Change-Id: If25fdb3ac8e85563c4857fb8216b3d9dc3d0fa53
bridges/bridge_native_rtp.c