[Asterisk-code-review] app_voicemail: Fix broken subscription (asterisk[16])
Richard Mudgett
asteriskteam at digium.com
Sat Aug 15 17:19:35 CDT 2020
Richard Mudgett has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/14731 )
Change subject: app_voicemail: Fix broken subscription
......................................................................
Patch Set 1: Code-Review-1
(4 comments)
Looks like the gcc 10 fixes made things worse with this function. 😞
https://gerrit.asterisk.org/c/asterisk/+/14731/1//COMMIT_MSG
Commit Message:
https://gerrit.asterisk.org/c/asterisk/+/14731/1//COMMIT_MSG@12
PS1, Line 12:
ASTERISK-29029 needs to be on a line by itself in the commit message.
https://gerrit.asterisk.org/c/asterisk/+/14731/1/apps/app_voicemail.c
File apps/app_voicemail.c:
https://gerrit.asterisk.org/c/asterisk/+/14731/1/apps/app_voicemail.c@13357
PS1, Line 13357: len = sizeof(*mwi_sub) + 1;
I think an end-of-line comment here:
/* Allow for mwi_sub->mailbox string terminator */
https://gerrit.asterisk.org/c/asterisk/+/14731/1/apps/app_voicemail.c@13361
PS1, Line 13361: context_len = strlen(p->context) + 1; /* Allow for seperator */
@kharwell possible NULL pointer dereference here. p-mailbox, p->context, and p->uniqueid might be NULL on entry to this function due to malloc failure. Thus their usage needs to be protected with a NULL check such as !ast_strlen_zero().
size_t context_len = 0;
...
if (!ast_strlen_zero(p->context)) {
context_len = strlen(p->context) + 1; /* Allow for separator */
len += context_len;
}
https://gerrit.asterisk.org/c/asterisk/+/14731/1/apps/app_voicemail.c@13374
PS1, Line 13374: ast_copy_string(mwi_sub->mailbox + strlen(p->mailbox)+1, p->context, context_len);
A safer thing to do would be to strlen(mwi_sub->mailbox) instead of strlen(p->mailbox)+1. p->mailbox might be NULL.
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/14731
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: I8be59d175b2b48e4d5b806df5581ac01a01531a3
Gerrit-Change-Number: 14731
Gerrit-PatchSet: 1
Gerrit-Owner: Karsten Wemheuer <kwe-digium at iptam.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Comment-Date: Sat, 15 Aug 2020 22:19:35 +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/20200815/12c6c3fa/attachment.html>
More information about the asterisk-code-review
mailing list