bridge_native_rtp.c: Fix native rtp bridge data race.
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:11:53 +0000 (14:11 -0600)
commitda6f40c9ff85fa665de30f89071f13d6da8f3cf1
treea50cd6039c17161907ea61252f1f56f310590664
parent059a54202c43ed19c802efb153f0da4962e5b75c
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