<p>N A has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/19728">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app_voicemail_odbc: Fix string overflow warning.<br><br>Fixes a negative offset warning by initializing<br>the buffer to empty.<br><br>Additionally, although it doesn't currently complain<br>about it, the size of a buffer is increased to<br>accomodate the maximum size contents it could have.<br><br>ASTERISK-30240 #close<br><br>Change-Id: I8eecedf14d3f2a75864797f802277cac89a32877<br>---<br>M apps/app_voicemail.c<br>1 file changed, 22 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/28/19728/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c</span><br><span>index 1aca59b..88dc342 100644</span><br><span>--- a/apps/app_voicemail.c</span><br><span>+++ b/apps/app_voicemail.c</span><br><span>@@ -4484,15 +4484,16 @@</span><br><span>  */</span><br><span> static int remove_file(char *dir, int msgnum)</span><br><span> {</span><br><span style="color: hsl(0, 100%, 40%);">- char fn[PATH_MAX];</span><br><span style="color: hsl(0, 100%, 40%);">-      char full_fn[PATH_MAX];</span><br><span style="color: hsl(120, 100%, 40%);">+       char fn[PATH_MAX] = "";</span><br><span style="color: hsl(120, 100%, 40%);">+     char full_fn[PATH_MAX + 4]; /* Plus .txt */</span><br><span>  char msgnums[80];</span><br><span> </span><br><span>        if (msgnum > -1) {</span><br><span>                snprintf(msgnums, sizeof(msgnums), "%d", msgnum);</span><br><span>          make_file(fn, sizeof(fn), dir, msgnum);</span><br><span style="color: hsl(0, 100%, 40%);">- } else</span><br><span style="color: hsl(120, 100%, 40%);">+        } else {</span><br><span>             ast_copy_string(fn, dir, sizeof(fn));</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span>    ast_filedelete(fn, NULL);</span><br><span>    snprintf(full_fn, sizeof(full_fn), "%s.txt", fn);</span><br><span>  unlink(full_fn);</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/19728">change 19728</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/c/asterisk/+/19728"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 18 </div>
<div style="display:none"> Gerrit-Change-Id: I8eecedf14d3f2a75864797f802277cac89a32877 </div>
<div style="display:none"> Gerrit-Change-Number: 19728 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: N A <asterisk@phreaknet.org> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>