[asterisk-dev] [Code Review] 3143: pjsip_configuration: in ast_sip_auth_array_init, change assert(auths->names == NULL) to ast_sip_auth_array_destroy(auths)

George Joseph reviewboard at asterisk.org
Thu Feb 6 08:50:18 CST 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/3143/
-----------------------------------------------------------

(Updated Feb. 6, 2014, 2:50 p.m.)


Status
------

This change has been marked as submitted.


Review request for Asterisk Developers.


Bugs: ASTERISK-23168
    https://issues.asterisk.org/jira/browse/ASTERISK-23168


Repository: Asterisk


Description
-------

Currently, ast_sip_auth_array_init asserts that auths->names is NULL effectively barfing if the array being initialized already contained auth names.  This works OK except where the sorcery object is derived from a template and the object tries to override the auth parameter.

Example:

[template](!)
type=registration
outbound_auth=someauth

[somereg](template)
type=registration
outbound_auth=someOTHERauth

Causes...
ERROR[29423]: res_pjsip/pjsip_configuration.c:236 ast_sip_auth_array_init: FRACK!, Failed assertion auths->names == NULL (0)
ERROR[29423]: res_pjsip/pjsip_configuration.c:237 ast_sip_auth_array_init: FRACK!, Failed assertion !auths->num (0)

This patch simply tests auths->names and if not null, calls ast_sip_auth_array_destroy before initializing the array with the new values.


Diffs
-----

  branches/12/res/res_pjsip/pjsip_configuration.c 405922 

Diff: https://reviewboard.asterisk.org/r/3143/diff/


Testing
-------


Thanks,

George Joseph

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20140206/5e389f88/attachment-0001.html>


More information about the asterisk-dev mailing list