[Asterisk-code-review] channel: Fix some more unprotected channel flag setting. (asterisk[15])

Jenkins2 asteriskteam at digium.com
Wed Jun 20 05:59:37 CDT 2018


Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/9193 )

Change subject: channel: Fix some more unprotected channel flag setting.
......................................................................

channel: Fix some more unprotected channel flag setting.

Change-Id: I34c3b1201b1de539945bcfdcb264fff30332d48c
---
M channels/chan_dahdi.c
M channels/sig_analog.c
M main/channel.c
3 files changed, 10 insertions(+), 0 deletions(-)

Approvals:
  George Joseph: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved
  Jenkins2: Approved for Submit



diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
index 36f5deb..77c6906 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -10035,7 +10035,9 @@
 				 * emulation.  The DTMF digits can come so fast that emulation
 				 * can drop some of them.
 				 */
+				ast_channel_lock(chan);
 				ast_set_flag(ast_channel_flags(chan), AST_FLAG_END_DTMF_ONLY);
+				ast_channel_unlock(chan);
 				off_ms = 4000;/* This is a typical OFF time between rings. */
 				for (;;) {
 					struct ast_frame *f;
@@ -10068,7 +10070,9 @@
 						ast_channel_state(chan) == AST_STATE_RINGING)
 						break; /* Got ring */
 				}
+				ast_channel_lock(chan);
 				ast_clear_flag(ast_channel_flags(chan), AST_FLAG_END_DTMF_ONLY);
+				ast_channel_unlock(chan);
 				dtmfbuf[k] = '\0';
 				dahdi_setlinear(p->subs[idx].dfd, p->subs[idx].linear);
 				/* Got cid and ring. */
diff --git a/channels/sig_analog.c b/channels/sig_analog.c
index 110942c..7f78daa 100644
--- a/channels/sig_analog.c
+++ b/channels/sig_analog.c
@@ -2402,7 +2402,9 @@
 				 * emulation.  The DTMF digits can come so fast that emulation
 				 * can drop some of them.
 				 */
+				ast_channel_lock(chan);
 				ast_set_flag(ast_channel_flags(chan), AST_FLAG_END_DTMF_ONLY);
+				ast_channel_unlock(chan);
 				timeout_ms = 4000;/* This is a typical OFF time between rings. */
 				for (;;) {
 					struct ast_frame *f;
@@ -2437,7 +2439,9 @@
 						break; /* Got ring */
 					}
 				}
+				ast_channel_lock(chan);
 				ast_clear_flag(ast_channel_flags(chan), AST_FLAG_END_DTMF_ONLY);
+				ast_channel_unlock(chan);
 				dtmfbuf[k] = '\0';
 
 				analog_set_linear_mode(p, idx, oldlinearity);
diff --git a/main/channel.c b/main/channel.c
index 92ec444..f056435 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -5922,7 +5922,9 @@
 	 */
 	ast_set_callerid(chan, cid_num, cid_name, cid_num);
 
+	ast_channel_lock(chan);
 	ast_set_flag(ast_channel_flags(chan), AST_FLAG_ORIGINATED);
+	ast_channel_unlock(chan);
 	ast_party_connected_line_set_init(&connected, ast_channel_connected(chan));
 	if (cid_num) {
 		connected.id.number.valid = 1;

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

Gerrit-Project: asterisk
Gerrit-Branch: 15
Gerrit-MessageType: merged
Gerrit-Change-Id: I34c3b1201b1de539945bcfdcb264fff30332d48c
Gerrit-Change-Number: 9193
Gerrit-PatchSet: 1
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180620/fc66da40/attachment.html>


More information about the asterisk-code-review mailing list