<p>George Joseph <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/11177">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Joshua Colp: Looks good to me, but someone else must approve
  Kevin Harwell: Looks good to me, approved
  George Joseph: Approved for Submit

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">pjsip: restrict function PJSIP_PARSE_URI to parse only SIP/SIPS URIs<br><br>The next usage of PJSIP_PARSE_URI will crash asterisk<br>${PJSIP_PARSE_URI(tel:+1234567890,host)}<br>or<br>${PJSIP_PARSE_URI(192.168.1.1:5060,host)}<br><br>The function pjsip_parse_uri successfully parses then, but returns<br>struct pjsip_other_uri *.<br><br>This patch restricts parsing only SIP/SIPS URIs.<br><br>Change-Id: I16f255c2b86a80a67e9f9604b94b129a381dd25e<br>---<br>M channels/pjsip/dialplan_functions.c<br>1 file changed, 1 insertion(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/channels/pjsip/dialplan_functions.c b/channels/pjsip/dialplan_functions.c</span><br><span>index 70507bb..2081bad 100644</span><br><span>--- a/channels/pjsip/dialplan_functions.c</span><br><span>+++ b/channels/pjsip/dialplan_functions.c</span><br><span>@@ -1124,7 +1124,7 @@</span><br><span> </span><br><span>         pj_strdup2_with_null(pool, &tmp, args->uri);</span><br><span>  uri = (pjsip_name_addr *)pjsip_parse_uri(pool, tmp.ptr, tmp.slen, PJSIP_PARSE_URI_AS_NAMEADDR);</span><br><span style="color: hsl(0, 100%, 40%);">- if (!uri) {</span><br><span style="color: hsl(120, 100%, 40%);">+   if (!uri || (!PJSIP_URI_SCHEME_IS_SIP(uri) && !PJSIP_URI_SCHEME_IS_SIPS(uri))) {</span><br><span>             ast_log(LOG_WARNING, "Failed to parse URI '%s'\n", args->uri);</span><br><span>          pjsip_endpt_release_pool(ast_sip_get_pjsip_endpoint(), pool);</span><br><span>                args->ret = -1;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/11177">change 11177</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/+/11177"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-Change-Id: I16f255c2b86a80a67e9f9604b94b129a381dd25e </div>
<div style="display:none"> Gerrit-Change-Number: 11177 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Alexei Gradinari <alex2grad@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Alexei Gradinari <alex2grad@gmail.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: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>