]> git.ipfire.org Git - thirdparty/asterisk.git/commit
bridge_native_rtp.c: Fix reentrancy framehook crash.
authorRichard Mudgett <rmudgett@digium.com>
Thu, 28 Dec 2017 04:36:58 +0000 (22:36 -0600)
committerRichard Mudgett <rmudgett@digium.com>
Thu, 28 Dec 2017 05:16:21 +0000 (23:16 -0600)
commit9f1cfbafcadbbcead3cedf9fc51263e95b234f17
treeea296e9f8dc2e66a6ccdd40d97fd1787635a4e07
parent92fb393cab7fbd164e299601e94909ba95a0116b
bridge_native_rtp.c: Fix reentrancy framehook crash.

If two channels enter different native rtp bridges at the same time it is
possible that the framehook interface data pointer can be corrupted
because the struct variable was declared static.

* Fixed the reentrancy corruption by changing the framehook interface
struct static variable to a stack local variable.

* Moved the hook.data assignment outside of the channel lock.  It did not
need the lock's protection.  It probably was giving a false sense of
security.

The testsuite
channels/pjsip/basic_calls/two_parties/nominal/alice_initiated/bob_hangs_up
test caught this with MALLOC_DEBUG and DO_CRASH enabled.

Change-Id: If9e35b97d19209b0f984941c1d8eb5f7c55eea91
bridges/bridge_native_rtp.c