mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
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 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@426552 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user