[Asterisk-code-review] app voicemail: Remove need to subscribe to stasis (asterisk[13])

Richard Mudgett asteriskteam at digium.com
Mon Sep 17 18:51:54 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;
               : 	}
> > However, we do need to be tolerant of NULL pointers […]
Oh.  Yes.  They theoretically could be NULL in the old place if the allocation failed. :)

However, vmu->context could be an empty string which would need to result in no '@' in the generated mailbox string.  It is difficult to determine if context would ever really be an empty string now and not be set to "default" if the user didn't configure a context.

Probably best not to make this change.



-- 
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 23:51:54 +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/15b82806/attachment.html>


More information about the asterisk-code-review mailing list