Skip to content
Snippets Groups Projects
Commit 0ed8aebd authored by Richard Mudgett's avatar Richard Mudgett
Browse files

bridge_builtin_features: Add missing channel locks around ast_get_chan_features_general_config().

The feature_automonitor() and feature_automixmonitor() functions were not
locking the channel around ast_get_chan_features_general_config().
Accessing the channel datastore list without the channel locked is a good
way to corrupt the list or follow the pointer chain into oblivion.
........

Merged revisions 426531 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 426552 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@426553 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 7205d76d
No related branches found
No related tags found
No related merge requests found
......@@ -226,7 +226,9 @@ static int feature_automonitor(struct ast_bridge_channel *bridge_channel, void *
RAII_VAR(struct ast_channel *, peer_chan, NULL, ast_channel_cleanup);
RAII_VAR(struct ast_features_general_config *, features_cfg, NULL, ao2_cleanup);
ast_channel_lock(bridge_channel->chan);
features_cfg = ast_get_chan_features_general_config(bridge_channel->chan);
ast_channel_unlock(bridge_channel->chan);
ast_bridge_channel_lock_bridge(bridge_channel);
peer_chan = ast_bridge_peer_nolock(bridge_channel->bridge, bridge_channel->chan);
ast_bridge_unlock(bridge_channel->bridge);
......@@ -412,7 +414,9 @@ static int feature_automixmonitor(struct ast_bridge_channel *bridge_channel, voi
RAII_VAR(struct ast_channel *, peer_chan, NULL, ast_channel_cleanup);
RAII_VAR(struct ast_features_general_config *, features_cfg, NULL, ao2_cleanup);
ast_channel_lock(bridge_channel->chan);
features_cfg = ast_get_chan_features_general_config(bridge_channel->chan);
ast_channel_unlock(bridge_channel->chan);
ast_bridge_channel_lock_bridge(bridge_channel);
peer_chan = ast_bridge_peer_nolock(bridge_channel->bridge, bridge_channel->chan);
ast_bridge_unlock(bridge_channel->bridge);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment