[Asterisk-code-review] res_stir_shaken: Add outbound INVITE support. (asterisk[master])
Kevin Harwell
asteriskteam at digium.com
Mon Jun 15 17:44:31 CDT 2020
Kevin Harwell has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/14509 )
Change subject: res_stir_shaken: Add outbound INVITE support.
......................................................................
Patch Set 2: Code-Review-1
(3 comments)
https://gerrit.asterisk.org/c/asterisk/+/14509/2/res/res_pjsip_stir_shaken.c
File res/res_pjsip_stir_shaken.c:
https://gerrit.asterisk.org/c/asterisk/+/14509/2/res/res_pjsip_stir_shaken.c@234
PS2, Line 234: encoded_header = ast_base64encode_string(ast_json_dump_string(header));
Memory leak here. ast_json_dump_string's return value must be freed using ast_json_free.
https://gerrit.asterisk.org/c/asterisk/+/14509/2/res/res_pjsip_stir_shaken.c@241
PS2, Line 241: encoded_payload = ast_base64encode_string(ast_json_dump_string(payload));
Same for this too. Result of dump string is leaked.
https://gerrit.asterisk.org/c/asterisk/+/14509/2/res/res_pjsip_stir_shaken.c@253
PS2, Line 253: combined_size = strlen(encoded_header) + 1 + strlen(encoded_payload) + 1
: + strlen(signature) + strlen(";info=<>alg=;ppt=") + strlen(public_key_url)
: + strlen(STIR_SHAKEN_ENCRYPTION_ALGORITHM) + strlen(STIR_SHAKEN_PPT) + 1;
I think you can remove all the +1's except the last one here as you only need one for the final null terminator.
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/14509
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: I1f84d6a5839cb2ed152ef4255b380cfc2de662b4
Gerrit-Change-Number: 14509
Gerrit-PatchSet: 2
Gerrit-Owner: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Comment-Date: Mon, 15 Jun 2020 22:44:31 +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/20200615/1d71f3a6/attachment.html>
More information about the asterisk-code-review
mailing list