<p>George Joseph <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/15262">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  George Joseph: Looks good to me, approved; Approved for Submit

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res/res_pjsip_diversion: prevent crash on tel: uri in History-Info<br><br>Add a check to see if the URI is a Tel URI and prevent crashing on<br>trying to retrieve the reason parameter.<br><br>ASTERISK-29191<br>ASTERISK-29219<br><br>Change-Id: I0320aa205f22cda511d60a2edf2b037e8fd6cc37<br>---<br>M res/res_pjsip_diversion.c<br>1 file changed, 9 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/res/res_pjsip_diversion.c b/res/res_pjsip_diversion.c</span><br><span>index 5b400d2..08f75e0 100644</span><br><span>--- a/res/res_pjsip_diversion.c</span><br><span>+++ b/res/res_pjsip_diversion.c</span><br><span>@@ -314,8 +314,14 @@</span><br><span> {</span><br><span>        static const pj_str_t cause_name = { "cause", 5 };</span><br><span>         pjsip_sip_uri *uri = pjsip_uri_get_uri(name_addr);</span><br><span style="color: hsl(0, 100%, 40%);">-      pjsip_param *cause = pjsip_param_find(&uri->other_param, &cause_name);</span><br><span style="color: hsl(0, 100%, 40%);">-       unsigned long cause_value;</span><br><span style="color: hsl(120, 100%, 40%);">+    pjsip_param *cause = NULL;</span><br><span style="color: hsl(120, 100%, 40%);">+    unsigned long cause_value = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+      if (!PJSIP_URI_SCHEME_IS_SIP(uri) && !PJSIP_URI_SCHEME_IS_SIPS(uri)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                return;</span><br><span style="color: hsl(120, 100%, 40%);">+       }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   cause = pjsip_param_find(&uri->other_param, &cause_name);</span><br><span> </span><br><span>     if (!cause) {</span><br><span>                return;</span><br><span>@@ -377,6 +383,7 @@</span><br><span>        ast_party_redirecting_init(&data);</span><br><span>       memset(&update, 0, sizeof(update));</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+   data.reason.code = AST_REDIRECTING_REASON_UNKNOWN;</span><br><span>   if (from_info) {</span><br><span>             set_redirecting_id((pjsip_name_addr*)from_info->uri,</span><br><span>                      &data.from, &update.from);</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/15262">change 15262</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/c/asterisk/+/15262"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13.38 </div>
<div style="display:none"> Gerrit-Change-Id: I0320aa205f22cda511d60a2edf2b037e8fd6cc37 </div>
<div style="display:none"> Gerrit-Change-Number: 15262 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Torrey Searle <tsearle@gmail.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>