<p>Kevin Harwell has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/7790">View Change</a></p><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;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/90/7790/1</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/7790">change 7790</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/7790"/><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: I19af23aeeded65be016be92360e8cb7ffe51fad2 </div>
<div style="display:none"> Gerrit-Change-Number: 7790 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Kevin Harwell <kharwell@digium.com> </div>