<p>N A has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/19563">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app_voicemail_odbc: Fix string overflow warning.<br><br>When using ast_copy_string, gcc complains about<br>a potential negative offset, so use strncpy instead.<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, 23 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/63/19563/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 510e15d..5c7dea9 100644</span><br><span>--- a/apps/app_voicemail.c</span><br><span>+++ b/apps/app_voicemail.c</span><br><span>@@ -4482,14 +4482,16 @@</span><br><span> static int remove_file(char *dir, int msgnum)</span><br><span> {</span><br><span> 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 full_fn[PATH_MAX + 4];</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(0, 100%, 40%);">- ast_copy_string(fn, dir, sizeof(fn));</span><br><span style="color: hsl(120, 100%, 40%);">+ } else {</span><br><span style="color: hsl(120, 100%, 40%);">+ strncpy(fn, dir, sizeof(fn));</span><br><span style="color: hsl(120, 100%, 40%);">+ fn[sizeof(fn) - 1] = '\0';</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/+/19563">change 19563</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/+/19563"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I8eecedf14d3f2a75864797f802277cac89a32877 </div>
<div style="display:none"> Gerrit-Change-Number: 19563 </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>