[Asterisk-code-review] Fixed null string trailing after AsyncAGIEnd AMI event (asterisk[master])
Richard Mudgett
asteriskteam at digium.com
Thu Feb 1 13:27:09 CST 2018
Richard Mudgett has posted comments on this change. ( https://gerrit.asterisk.org/8047 )
Change subject: Fixed null string trailing after AsyncAGIEnd AMI event
......................................................................
Patch Set 4: Code-Review-1
(3 comments)
https://gerrit.asterisk.org/#/c/8047/4//COMMIT_MSG
Commit Message:
https://gerrit.asterisk.org/#/c/8047/4//COMMIT_MSG@7
PS4, Line 7: Fixed null string trailing after AsyncAGIEnd AMI event
manager.c: Fixed "(null):" header in AMI AsyncAGIEnd event
https://gerrit.asterisk.org/#/c/8047/4/main/manager.c
File main/manager.c:
https://gerrit.asterisk.org/#/c/8047/4/main/manager.c@1773
PS4, Line 1773: if (!obj || (!res && !(*res) && (!(*res = ast_str_create(1024))))) {
While you are fixing the other error you should fix this bad expression too. It doesn't cover the error conditions it is trying to handle. It should be:
if (!obj || !res || (!*res && !(*res = ast_str_create(1024)))) {
}
https://gerrit.asterisk.org/#/c/8047/4/main/manager.c@1809
PS4, Line 1809: if (ast_json_is_null(blob)) {
: ast_str_append(&res, 0, "%s", "");
: }
: else {
: manager_json_to_ast_str(blob, NULL, &res, exclusion_cb);
: }
There is no need to append an empty string to the just created ast_str res. It is already an empty string.
if (!ast_json_is_null(blob)) {
manager_json_to_ast_str(blob, NULL, &res, exclusion_cb);
}
--
To view, visit https://gerrit.asterisk.org/8047
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ice58c16361f9d9e8648261c9ed5d6c8245fb0d8f
Gerrit-Change-Number: 8047
Gerrit-PatchSet: 4
Gerrit-Owner: sungtae kim <pchero21 at gmail.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: sungtae kim <pchero21 at gmail.com>
Gerrit-Comment-Date: Thu, 01 Feb 2018 19:27:09 +0000
Gerrit-HasComments: Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180201/8bbc7347/attachment.html>
More information about the asterisk-code-review
mailing list