[Asterisk-code-review] res fax: Fix a tight race condition causing fax to crash in ... (asterisk[11])

Anonymous Coward asteriskteam at digium.com
Wed Oct 12 08:15:26 CDT 2016


Anonymous Coward #1000019 has submitted this change and it was merged.

Change subject: res_fax: Fix a tight race condition causing fax to crash in audio fallback
......................................................................


res_fax: Fix a tight race condition causing fax to crash in audio fallback

When T.38 gets rejected and G711 failback occurs there is a period of
time where neither AST_FAX_TECH_T38 nor AST_FAX_TECH_AUDIO is set,
leading to a crash.

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

Approvals:
  George Joseph: Looks good to me, approved
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, but someone else must approve



diff --git a/res/res_fax.c b/res/res_fax.c
index 833a3c8..0636540 100644
--- a/res/res_fax.c
+++ b/res/res_fax.c
@@ -1344,6 +1344,13 @@
 	ast_format_clear(&orig_read_format);
 	chancount = 1;
 
+	/* Make sure one or the other is set to avoid race condition */
+	if (t38negotiated) {
+		details->caps |= AST_FAX_TECH_T38;
+	} else {
+		details->caps |= AST_FAX_TECH_AUDIO;
+	}
+
 	/* create the FAX session */
 	if (!(fax = fax_session_new(details, chan, reserved, token))) {
 		ast_log(LOG_ERROR, "Can't create a FAX session, FAX attempt failed.\n");

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Icc3f457b2292d48a9d7843dac0028347420cc982
Gerrit-PatchSet: 3
Gerrit-Project: asterisk
Gerrit-Branch: 11
Gerrit-Owner: Torrey Searle <tsearle at gmail.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>



More information about the asterisk-code-review mailing list