<p>Richard Mudgett has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/9959">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_pjsip_t38.c: Fix crash if already saw a final T.38 reINVITE response.<br><br>We were still getting crashes after the first fix. Somehow we receive a<br>non-2xx final response before we get a 200 final response. With the<br>failure response we had already cleaned up and destroyed some data<br>structures. When the unexpected 200 response comes in we crash.<br><br>* Add protection code to prevent processing another final T.38 reINVITE<br>response.<br><br>ASTERISK-27944<br><br>Change-Id: I8b5baba8d07fe4d63f0d7d05d3eb9a3d27d40a74<br>---<br>M res/res_pjsip_t38.c<br>1 file changed, 9 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/59/9959/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/res/res_pjsip_t38.c b/res/res_pjsip_t38.c</span><br><span>index 72f7b86..fae6fbb 100644</span><br><span>--- a/res/res_pjsip_t38.c</span><br><span>+++ b/res/res_pjsip_t38.c</span><br><span>@@ -300,6 +300,15 @@</span><br><span> return 0;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ if (session->t38state != T38_LOCAL_REINVITE) {</span><br><span style="color: hsl(120, 100%, 40%);">+ /* Do nothing. We have already processed a final response. */</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_debug(3, "Received %d response to T.38 re-invite on '%s' but already had a final response (T.38 state:%d)\n",</span><br><span style="color: hsl(120, 100%, 40%);">+ status.code,</span><br><span style="color: hsl(120, 100%, 40%);">+ session->channel ? ast_channel_name(session->channel) : "unknown channel",</span><br><span style="color: hsl(120, 100%, 40%);">+ session->t38state);</span><br><span style="color: hsl(120, 100%, 40%);">+ return 0;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> state = t38_state_get_or_alloc(session);</span><br><span> if (!session->channel || !state) {</span><br><span> ast_log(LOG_WARNING, "Received %d response to T.38 re-invite on '%s' but state unavailable\n",</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/9959">change 9959</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/9959"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 15 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I8b5baba8d07fe4d63f0d7d05d3eb9a3d27d40a74 </div>
<div style="display:none"> Gerrit-Change-Number: 9959 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Richard Mudgett <rmudgett@digium.com> </div>