summaryrefslogtreecommitdiff
path: root/main/bridge_channel.c
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2016-06-30 15:17:02 -0500
committerRichard Mudgett <rmudgett@digium.com>2016-06-30 15:38:11 -0500
commit4f7b85972669500d7f52598811935ebedfdee545 (patch)
tree69bd4253c00584763a2ae22078e42ef4787237f3 /main/bridge_channel.c
parent5ad7e1c09a7db698f0e4dd95f9153a70f8a1c667 (diff)
features: Fix channel datastore access.
Found as a result of the testsuite tests/callparking test crashing. Several calls to ast_get_chan_featuremap_config() and ast_get_chan_features_xfer_config() did not lock the channel before calling so the channel's datastore list was accessed without the lock's protection. Apparently another thread deleted a datastore on the channel's list while the crashing thread was walking the list. Crash at 0xdeaddead due to MALLOC_DEBUG's memory filler value as a result. * Add missing channel locks to calls that were not already protected as the doxygen for those calls indicates. Change-Id: Id273b3d305cc616406c353cbc841b2b7655efaa1
Diffstat (limited to 'main/bridge_channel.c')
-rw-r--r--main/bridge_channel.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/main/bridge_channel.c b/main/bridge_channel.c
index 3ba61aa33..18f719506 100644
--- a/main/bridge_channel.c
+++ b/main/bridge_channel.c
@@ -1543,8 +1543,13 @@ static void testsuite_notify_feature_success(struct ast_channel *chan, const cha
{
#ifdef TEST_FRAMEWORK
char *feature = "unknown";
- struct ast_featuremap_config *featuremap = ast_get_chan_featuremap_config(chan);
- struct ast_features_xfer_config *xfer = ast_get_chan_features_xfer_config(chan);
+ struct ast_featuremap_config *featuremap;
+ struct ast_features_xfer_config *xfer;
+
+ ast_channel_lock(chan);
+ featuremap = ast_get_chan_featuremap_config(chan);
+ xfer = ast_get_chan_features_xfer_config(chan);
+ ast_channel_unlock(chan);
if (featuremap) {
if (!strcmp(dtmf, featuremap->blindxfer)) {