<p style="white-space: pre-wrap; word-wrap: break-word;">It's low impact and improves the quality of the code, so let's go ahead and change it. The "Allow for separator and terminator" should be removed during that process.</p><p><a href="https://gerrit.asterisk.org/10132">View Change</a></p><p>1 comment:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/#/c/10132/6/apps/app_voicemail.c">File apps/app_voicemail.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10132/6/apps/app_voicemail.c@12195">Patch Set #6, Line 12195:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;">        char *mailbox;<br><br>      if (!ast_strlen_zero(vmu->mailbox)) {<br>              len += strlen(vmu->mailbox);<br>       }<br><br>   if (!ast_strlen_zero(vmu->context)) {<br>              len += strlen(vmu->context) + 1; /* Allow for seperator and terminator */<br>  }<br><br>   mailbox = ast_alloca(len);<br>    if (!ast_strlen_zero(vmu->mailbox)) {<br>              strcpy(mailbox, vmu->mailbox); /* Safe */<br>  }<br><br>   if (!ast_strlen_zero(vmu->context)) {<br>              strcat(mailbox, "@");  /* Safe */<br>           strcat(mailbox, vmu->context);  /* Safe */<br> }<br><br>   if (ast_strlen_zero(mailbox)) {<br>               ast_log(LOG_ERROR, "Mailbox can't be empty\n");<br>         return -1;<br>    }<br></pre></blockquote></p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">Oh.  Yes.  They theoretically could be NULL in the old place if the<br>allocation failed. :)</p><p style="white-space: pre-wrap; word-wrap: break-word;">However, vmu->context could be an empty string which would need to<br>result in no '@' in the generated mailbox string.  It is difficult<br>to determine if context would ever really be an empty string now<br>and not be set to "default" if the user didn't configure a context.</p><p style="white-space: pre-wrap; word-wrap: break-word;">Probably best not to make this change.</p></blockquote></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/10132">change 10132</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/10132"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-MessageType: comment </div>
<div style="display:none"> Gerrit-Change-Id: I5cceb737246949f9782955c64425b8bd25a9e9ee </div>
<div style="display:none"> Gerrit-Change-Number: 10132 </div>
<div style="display:none"> Gerrit-PatchSet: 6 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Sean Bright <sean.bright@gmail.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Tue, 18 Sep 2018 12:14:41 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-HasLabels: No </div>