<p>Joshua Colp has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/7096">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_pjsip: Avoid crash when contact uri is empty string<br><br>Asterisk will crash if contact uri is invalid, so contact_apply_handler<br>should check if the uri is NULL or empty.<br><br>ASTERISK-27393 #close<br>Reported-by: Aaron An<br>Tested-by: AaronAn<br><br>Change-Id: Ia0309bdc6b697c73c9c736e1caec910b77ca69f5<br>---<br>M res/res_pjsip/location.c<br>1 file changed, 5 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/96/7096/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/res/res_pjsip/location.c b/res/res_pjsip/location.c<br>index 66fc85c..8ba409e 100644<br>--- a/res/res_pjsip/location.c<br>+++ b/res/res_pjsip/location.c<br>@@ -1226,6 +1226,11 @@<br> struct ast_sip_contact_status *status;<br> struct ast_sip_contact *contact = object;<br> <br>+ if (ast_strlen_zero(contact->uri)) {<br>+ ast_log(LOG_ERROR, "A URI on dynamic contact '%s' is empty\n",<br>+ ast_sorcery_object_get_id(contact));<br>+ return -1;<br>+ }<br> status = ast_res_pjsip_find_or_create_contact_status(contact);<br> ao2_cleanup(status);<br> <br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/7096">change 7096</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/7096"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ia0309bdc6b697c73c9c736e1caec910b77ca69f5 </div>
<div style="display:none"> Gerrit-Change-Number: 7096 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Aaron An <anjb@ti-net.com.cn> </div>