<p>Joshua Colp <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/7791">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Benjamin Keith Ford: Looks good to me, but someone else must approve
Corey Farrell: Looks good to me, but someone else must approve
Joshua Colp: Looks good to me, approved; Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_pjsip_session: Check if sequence header is missing<br><br>The pjsip_msg_find_hdr function can return NULL. This patch adds a check<br>when searching for the sequence header to make sure a NULL pointer is never<br>de-referenced.<br><br>Change-Id: I19af23aeeded65be016be92360e8cb7ffe51fad2<br>---<br>M res/res_pjsip_session.c<br>1 file changed, 6 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/res/res_pjsip_session.c b/res/res_pjsip_session.c<br>index 64c150e..c339382 100644<br>--- a/res/res_pjsip_session.c<br>+++ b/res/res_pjsip_session.c<br>@@ -3309,6 +3309,12 @@<br> struct ast_sip_session_supplement *supplement;<br> struct pjsip_status_line status = tdata->msg->line.status;<br> pjsip_cseq_hdr *cseq = pjsip_msg_find_hdr(tdata->msg, PJSIP_H_CSEQ, NULL);<br>+<br>+ if (!cseq) {<br>+ ast_log(LOG_ERROR, "Cannot send response due to missing sequence header");<br>+ return;<br>+ }<br>+<br> ast_debug(3, "Method is %.*s, Response is %d %.*s\n", (int) pj_strlen(&cseq->method.name),<br> pj_strbuf(&cseq->method.name), status.code, (int) pj_strlen(&status.reason),<br> pj_strbuf(&status.reason));<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/7791">change 7791</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/7791"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I19af23aeeded65be016be92360e8cb7ffe51fad2 </div>
<div style="display:none"> Gerrit-Change-Number: 7791 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Benjamin Keith Ford <bford@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>