[Asterisk-code-review] res pjsip: Avoid crash when contact uri is empty string (asterisk[master])

Joshua Colp asteriskteam at digium.com
Mon Nov 6 04:30:05 CST 2017


Joshua Colp has posted comments on this change. ( https://gerrit.asterisk.org/6997 )

Change subject: res_pjsip:  Avoid crash when contact uri is empty string
......................................................................


Patch Set 1: Code-Review-1

(2 comments)

https://gerrit.asterisk.org/#/c/6997/1/res/res_pjsip/location.c
File res/res_pjsip/location.c:

https://gerrit.asterisk.org/#/c/6997/1/res/res_pjsip/location.c@1222
PS1, Line 1222: 	if(contact->uri == NULL || ast_strlen_zero(contact->uri)){
The ast_strlen_zero function already handles if the passed in string is NULL so the initial check is not needed.


https://gerrit.asterisk.org/#/c/6997/1/res/res_pjsip/location.c@1223
PS1, Line 1223: 		ast_log(LOG_ERROR, "Contact uri is empty\n");
This error message isn't helpful for users - it doesn't explain what AOR has an empty contact. It would be better as:

ast_log(LOG_ERROR, "A contact on AOR '%s' is empty\n", ast_sorcery_object_get_id(object));



-- 
To view, visit https://gerrit.asterisk.org/6997
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia0309bdc6b697c73c9c736e1caec910b77ca69f5
Gerrit-Change-Number: 6997
Gerrit-PatchSet: 1
Gerrit-Owner: Aaron An <anjb at ti-net.com.cn>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Comment-Date: Mon, 06 Nov 2017 10:30:05 +0000
Gerrit-HasComments: Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171106/660394d5/attachment.html>


More information about the asterisk-code-review mailing list