<p>George Joseph has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/6384">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, 5 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/84/6384/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 648c753..f61f4fc 100644<br>--- a/res/res_pjsip_t38.c<br>+++ b/res/res_pjsip_t38.c<br>@@ -294,21 +294,23 @@<br> {<br> struct pjsip_status_line status = rdata->msg_info.msg->line.status;<br> struct t38_state *state;<br>- RAII_VAR(struct ast_sip_session_media *, session_media, NULL, ao2_cleanup);<br>+ struct ast_sip_session_media *session_media;<br> <br> if (status.code == 100) {<br> return 0;<br> }<br> <br>- if (!(state = t38_state_get_or_alloc(session)) ||<br>+ if (!session->channel || !(state = t38_state_get_or_alloc(session)) ||<br> !(session_media = ao2_find(session->media, "image", OBJ_KEY))) {<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> t38_change_state(session, session_media, state, (status.code == 200) ? T38_ENABLED : T38_REJECTED);<br> <br>+ ao2_cleanup(session_media);<br> return 0;<br> }<br> <br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/6384">change 6384</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/6384"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </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: 6384 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>