<p>Aaron An has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/6997">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, 4 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/97/6997/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 9945c7c..2dd9419 100644<br>--- a/res/res_pjsip/location.c<br>+++ b/res/res_pjsip/location.c<br>@@ -1219,6 +1219,10 @@<br> struct ast_sip_contact_status *status;<br> struct ast_sip_contact *contact = object;<br> <br>+ if(contact->uri == NULL || ast_strlen_zero(contact->uri)){<br>+ ast_log(LOG_ERROR, "Contact uri is empty\n");<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/6997">change 6997</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/6997"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </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: 6997 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Aaron An <anjb@ti-net.com.cn> </div>