[Asterisk-code-review] res pjsip: Fix crash with from user containing invalid chara... (asterisk[13])

Richard Mudgett asteriskteam at digium.com
Fri Jul 7 17:59:01 CDT 2017


Richard Mudgett has posted comments on this change. ( https://gerrit.asterisk.org/5974 )

Change subject: res_pjsip: Fix crash with from_user containing invalid characters.
......................................................................


Patch Set 3: Code-Review-1

(4 comments)

https://gerrit.asterisk.org/#/c/5974/3/res/res_pjsip.c
File res/res_pjsip.c:

https://gerrit.asterisk.org/#/c/5974/3/res/res_pjsip.c@3082
PS3, Line 3082: 		return NULL;
Need to clean up on this error exit:

dlg->sess_count--;
pjsip_dlg_terminate(dlg);
return NULL;


https://gerrit.asterisk.org/#/c/5974/3/res/res_pjsip/pjsip_configuration.c
File res/res_pjsip/pjsip_configuration.c:

https://gerrit.asterisk.org/#/c/5974/3/res/res_pjsip/pjsip_configuration.c@1161
PS3, Line 1161: 	for (val = ast_strdupa(var->value); *val; val++) {
You don't even need to call ast_strdupa() since you are not modifying var->value in either place it is called.


https://gerrit.asterisk.org/#/c/5974/3/res/res_pjsip/pjsip_configuration.c@1163
PS3, Line 1163: 			return -1;
Should add an error message like in tos_handler().


https://gerrit.asterisk.org/#/c/5974/3/res/res_pjsip/pjsip_configuration.c@1167
PS3, Line 1167: 	if (ast_string_field_set(endpoint, fromuser, ast_strdupa(var->value)) == -1) {
              : 		return -1;
              : 	}
You may as well treat ast_string_field_set() as a void function.  No where else in the system checks the return value.



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

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: comment
Gerrit-Change-Id: I0396fdb5080604e0bdf1277464d5c8a85db913d0
Gerrit-Change-Number: 5974
Gerrit-PatchSet: 3
Gerrit-Owner: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Comment-Date: Fri, 07 Jul 2017 22:59:01 +0000
Gerrit-HasComments: Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20170707/4495e695/attachment.html>


More information about the asterisk-code-review mailing list