<p>George Joseph has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/6386">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_pjsip_t38:  Make t38_reinvite_response_cb tolerant of NULL channel<br><br>t38_reinvite_response_cb can get called by res_pjsip_session's<br>session_inv_on_tsx_state_changed in situations where session->channel<br>is NULL.  If it is, the ast_log warning segfaults because it tries<br>to get the channel name from a NULL channel.<br><br>* Check session->channel and print "unknown channel" when it's NULL.<br><br>ASTERISK-27236<br>Reported by: Ross Beer<br><br>Change-Id: I4326e288d36327f6c79ab52226d54905cdc87dc7<br>---<br>M res/res_pjsip_t38.c<br>1 file changed, 4 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/86/6386/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/res/res_pjsip_t38.c b/res/res_pjsip_t38.c<br>index 27eff42..bb4a1d2 100644<br>--- a/res/res_pjsip_t38.c<br>+++ b/res/res_pjsip_t38.c<br>@@ -302,9 +302,10 @@<br>  }<br> <br>  state = t38_state_get_or_alloc(session);<br>-     if (!state) {<br>+        if (!session->channel || !state) {<br>                 ast_log(LOG_WARNING, "Received response to T.38 re-invite on '%s' but state unavailable\n",<br>-                        ast_channel_name(session->channel));<br>+                      session->channel ? ast_channel_name(session->channel) : "unknown channel");<br>+          ao2_cleanup(session_media);<br>           return 0;<br>     }<br> <br>@@ -334,6 +335,7 @@<br>             ast_sip_session_media_state_reset(session->pending_media_state);<br>   }<br> <br>+ ao2_cleanup(session_media);<br>   return 0;<br> }<br> <br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/6386">change 6386</a>. To unsubscribe, 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/6386"/><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: I4326e288d36327f6c79ab52226d54905cdc87dc7 </div>
<div style="display:none"> Gerrit-Change-Number: 6386 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>