[Asterisk-code-review] res pjsip: set callerid tag to empty string (asterisk[13])
Richard Mudgett
asteriskteam at digium.com
Fri Oct 12 13:15:30 CDT 2018
Richard Mudgett has posted comments on this change. ( https://gerrit.asterisk.org/10476 )
Change subject: res_pjsip: set callerid_tag to empty string
......................................................................
Patch Set 1: Code-Review-1
(3 comments)
https://gerrit.asterisk.org/#/c/10476/1/res/res_pjsip/pjsip_configuration.c
File res/res_pjsip/pjsip_configuration.c:
https://gerrit.asterisk.org/#/c/10476/1/res/res_pjsip/pjsip_configuration.c@593
PS1, Line 593: ast_free(endpoint->id.self.name.str);
: endpoint->id.self.name.valid = 0;
: ast_free(endpoint->id.self.number.str);
: endpoint->id.self.number.valid = 0;
You need to explicitly set the freed pointer to NULL or you could have stale pointers and a future double free.
https://gerrit.asterisk.org/#/c/10476/1/res/res_pjsip/pjsip_configuration.c@665
PS1, Line 665: if (!var->value) {
: return 0;
: }
:
Test not needed because var->value can never be NULL
See ast_variable_new()
https://gerrit.asterisk.org/#/c/10476/1/res/res_pjsip/pjsip_configuration.c@2044
PS1, Line 2044: if (!endpoint->id.self.tag) {
: endpoint->id.self.tag=ast_strdup("");
: }
* Just need to ast_strdup() into the tag. ast_party_id_init() will always return with tag NULL.
* guidelines: spaces around assignment operator '='
--
To view, visit https://gerrit.asterisk.org/10476
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: comment
Gerrit-Change-Id: I86ba455c4677ca8d516d9a04ce7fb4d24dd576e4
Gerrit-Change-Number: 10476
Gerrit-PatchSet: 1
Gerrit-Owner: Alexei Gradinari <alex2grad at gmail.com>
Gerrit-Reviewer: Jenkins2 (1000185)
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Comment-Date: Fri, 12 Oct 2018 18:15:30 +0000
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20181012/c41ca25f/attachment.html>
More information about the asterisk-code-review
mailing list