[Asterisk-code-review] res/res_pjsip_messaging.c: Fix: unstable domain filed in To header (asterisk[18])
Sean Bright
asteriskteam at digium.com
Thu Apr 22 10:11:21 CDT 2021
Sean Bright has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/15727 )
Change subject: res/res_pjsip_messaging.c: Fix: unstable domain filed in To header
......................................................................
Patch Set 1: Code-Review-1
(4 comments)
https://gerrit.asterisk.org/c/asterisk/+/15727/1/res/res_pjsip_messaging.c
File res/res_pjsip_messaging.c:
https://gerrit.asterisk.org/c/asterisk/+/15727/1/res/res_pjsip_messaging.c@250
PS1, Line 250: if(domain_start) {
Space before (
https://gerrit.asterisk.org/c/asterisk/+/15727/1/res/res_pjsip_messaging.c@251
PS1, Line 251: domain_start += 12; /* 12 is sizeof("x-to_domain") */
Just use sizeof("x-to_domain") instead of hardcoding 12.
https://gerrit.asterisk.org/c/asterisk/+/15727/1/res/res_pjsip_messaging.c@254
PS1, Line 254: if(domain_end){
Space before ( and before {
https://gerrit.asterisk.org/c/asterisk/+/15727/1/res/res_pjsip_messaging.c@256
PS1, Line 256: tmp_ptr = (char *)ast_malloc(domain_len + 1);
: strncpy(tmp_ptr, domain_start, domain_len);
: tmp_ptr[domain_len + 1]= '\0';
Use ast_strndup (and don't cast the result). Also check to make sure it doesn't return NULL.
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/15727
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 18
Gerrit-Change-Id: Ib164d5274ffe73db15811d4decfc50e6eddcf80c
Gerrit-Change-Number: 15727
Gerrit-PatchSet: 1
Gerrit-Owner: Yang Chen <yang.chen at linuxe.org>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Sean Bright <sean at seanbright.com>
Gerrit-CC: Joshua Colp <jcolp at sangoma.com>
Gerrit-Comment-Date: Thu, 22 Apr 2021 15:11:21 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210422/bfa98048/attachment.html>
More information about the asterisk-code-review
mailing list