<p> Attention is currently required from: Torrey Searle. </p>
<p>George Joseph would like Torrey Searle to <strong>review</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/15266">View Change</a></p><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, 12 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/66/15266/1</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 7153b54..b809f15 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,10 +383,13 @@</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 style="color: hsl(0, 100%, 40%);">- set_redirecting_reason(from_info, to_info, &data.reason);</span><br><span style="color: hsl(120, 100%, 40%);">+ if (to_info) {</span><br><span style="color: hsl(120, 100%, 40%);">+ set_redirecting_reason(from_info, to_info, &data.reason);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span> ast_set_party_id_all(&update.priv_to);</span><br><span> } else {</span><br><span> copy_redirecting_id(&data.from, &session->id, &update.from);</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/15266">change 15266</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/+/15266"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 18 </div>
<div style="display:none"> Gerrit-Change-Id: I0320aa205f22cda511d60a2edf2b037e8fd6cc37 </div>
<div style="display:none"> Gerrit-Change-Number: 15266 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Torrey Searle <tsearle@gmail.com> </div>
<div style="display:none"> Gerrit-Attention: Torrey Searle <tsearle@gmail.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>