[Asterisk-code-review] app voicemail: Remove need to subscribe to stasis (asterisk[13])
Richard Mudgett
asteriskteam at digium.com
Mon Sep 17 17:53:21 CDT 2018
Richard Mudgett has posted comments on this change. ( https://gerrit.asterisk.org/10132 )
Change subject: app_voicemail: Remove need to subscribe to stasis
......................................................................
Patch Set 6:
(1 comment)
https://gerrit.asterisk.org/#/c/10132/6/apps/app_voicemail.c
File apps/app_voicemail.c:
https://gerrit.asterisk.org/#/c/10132/6/apps/app_voicemail.c@12195
PS6, Line 12195: char *mailbox;
:
: if (!ast_strlen_zero(vmu->mailbox)) {
: len += strlen(vmu->mailbox);
: }
:
: if (!ast_strlen_zero(vmu->context)) {
: len += strlen(vmu->context) + 1; /* Allow for seperator and terminator */
: }
:
: mailbox = ast_alloca(len);
: if (!ast_strlen_zero(vmu->mailbox)) {
: strcpy(mailbox, vmu->mailbox); /* Safe */
: }
:
: if (!ast_strlen_zero(vmu->context)) {
: strcat(mailbox, "@"); /* Safe */
: strcat(mailbox, vmu->context); /* Safe */
: }
:
: if (ast_strlen_zero(mailbox)) {
: ast_log(LOG_ERROR, "Mailbox can't be empty\n");
: return -1;
: }
> I may not be understanding something, but this seems unnecessarily complicated. […]
This was pulled out of handle_subscribe() but yes it would be simpler. However, we do need to be tolerant of NULL pointers passed to snprintf() from vmu->mailbox and vmu->context.
This also pointed out that the "/* Allow for separator and terminator */" comment is no longer accurate as the terminator is not accounted for there anymore.
--
To view, visit https://gerrit.asterisk.org/10132
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: I5cceb737246949f9782955c64425b8bd25a9e9ee
Gerrit-Change-Number: 10132
Gerrit-PatchSet: 6
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Sean Bright <sean.bright at gmail.com>
Gerrit-Comment-Date: Mon, 17 Sep 2018 22:53:21 +0000
Gerrit-HasComments: Yes
Gerrit-HasLabels: No
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180917/122c03f1/attachment.html>
More information about the asterisk-code-review
mailing list