[asterisk-commits] ast framehook detach() must be called with the channel locked. (asterisk[11])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Aug 26 18:09:14 CDT 2016


Joshua Colp has submitted this change and it was merged.

Change subject: ast_framehook_detach() must be called with the channel locked.
......................................................................


ast_framehook_detach() must be called with the channel locked.

The framehook container could become corrupted if the channel lock is not
held before calling.

Change-Id: If0a1c7ba0484ed3a191106a7516526b905952584
---
M res/res_fax.c
1 file changed, 4 insertions(+), 0 deletions(-)

Approvals:
  Kevin Harwell: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved; Verified



diff --git a/res/res_fax.c b/res/res_fax.c
index ad62f02..ee0dc8c 100644
--- a/res/res_fax.c
+++ b/res/res_fax.c
@@ -4055,7 +4055,9 @@
 				ast_log(LOG_WARNING, "Attempt to attach a T.38 gateway on channel (%s) with gateway already running.\n", ast_channel_name(chan));
 			}
 		} else if (ast_false(val)) {
+			ast_channel_lock(chan);
 			ast_framehook_detach(chan, details->gateway_id);
+			ast_channel_unlock(chan);
 			details->gateway_id = -1;
 		} else {
 			ast_log(LOG_WARNING, "Unsupported value '%s' passed to FAXOPT(%s).\n", value, data);
@@ -4100,7 +4102,9 @@
 				ast_log(LOG_WARNING, "Attempt to attach a FAX detect on channel (%s) with FAX detect already running.\n", ast_channel_name(chan));
 			}
 		} else if (ast_false(val)) {
+			ast_channel_lock(chan);
 			ast_framehook_detach(chan, details->faxdetect_id);
+			ast_channel_unlock(chan);
 			details->faxdetect_id = -1;
 		} else {
 			ast_log(LOG_WARNING, "Unsupported value '%s' passed to FAXOPT(%s).\n", value, data);

-- 
To view, visit https://gerrit.asterisk.org/3701
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: If0a1c7ba0484ed3a191106a7516526b905952584
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 11
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>



More information about the asterisk-commits mailing list