[Asterisk-code-review] app voicemail: Fix stack overrun in append mailbox (asterisk[13])

Sean Bright asteriskteam at digium.com
Fri Sep 21 14:45:12 CDT 2018


Sean Bright has posted comments on this change. ( https://gerrit.asterisk.org/10235 )

Change subject: app_voicemail:  Fix stack overrun in append_mailbox
......................................................................


Patch Set 1: Code-Review-1

(1 comment)

https://gerrit.asterisk.org/#/c/10235/1/apps/app_voicemail.c
File apps/app_voicemail.c:

https://gerrit.asterisk.org/#/c/10235/1/apps/app_voicemail.c@12328
PS1, Line 12328: 	len = sizeof(box) + sizeof(context) + sizeof('@') + 1;
               : 	mailbox_full = ast_alloca(len);
               : 	snprintf(mailbox_full, len, "%s%s%s",
               : 		box,
               : 		ast_strlen_zero(context) ? "" : "@",
               : 		context);
Similar to the other app_voicemail patch from the other day, because these things are compile time constants, I don't see any benefit of doing this over:

 char mailbox_full[sizeof(box) + …];

It's 162 bytes.



-- 
To view, visit https://gerrit.asterisk.org/10235
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: I7eb51c7bd18a7a8dbdba261462a95cc69e84f161
Gerrit-Change-Number: 10235
Gerrit-PatchSet: 1
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Sean Bright <sean.bright at gmail.com>
Gerrit-Comment-Date: Fri, 21 Sep 2018 19:45:12 +0000
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180921/21de9095/attachment.html>


More information about the asterisk-code-review mailing list