app_voicemail_odbc: Fix string overflow warning.
Fixes a negative offset warning by initializing the buffer to empty. Additionally, although it doesn't currently complain about it, the size of a buffer is increased to accomodate the maximum size contents it could have. ASTERISK-30240 #close Change-Id: I8eecedf14d3f2a75864797f802277cac89a32877
This commit is contained in:
parent
cbb1fd2cb9
commit
20d4775d0a
|
@ -4484,15 +4484,16 @@ static void rename_file(char *sdir, int smsg, char *mailboxuser, char *mailboxco
|
||||||
*/
|
*/
|
||||||
static int remove_file(char *dir, int msgnum)
|
static int remove_file(char *dir, int msgnum)
|
||||||
{
|
{
|
||||||
char fn[PATH_MAX];
|
char fn[PATH_MAX] = "";
|
||||||
char full_fn[PATH_MAX];
|
char full_fn[PATH_MAX + 4]; /* Plus .txt */
|
||||||
char msgnums[80];
|
char msgnums[80];
|
||||||
|
|
||||||
if (msgnum > -1) {
|
if (msgnum > -1) {
|
||||||
snprintf(msgnums, sizeof(msgnums), "%d", msgnum);
|
snprintf(msgnums, sizeof(msgnums), "%d", msgnum);
|
||||||
make_file(fn, sizeof(fn), dir, msgnum);
|
make_file(fn, sizeof(fn), dir, msgnum);
|
||||||
} else
|
} else {
|
||||||
ast_copy_string(fn, dir, sizeof(fn));
|
ast_copy_string(fn, dir, sizeof(fn));
|
||||||
|
}
|
||||||
ast_filedelete(fn, NULL);
|
ast_filedelete(fn, NULL);
|
||||||
snprintf(full_fn, sizeof(full_fn), "%s.txt", fn);
|
snprintf(full_fn, sizeof(full_fn), "%s.txt", fn);
|
||||||
unlink(full_fn);
|
unlink(full_fn);
|
||||||
|
|
Loading…
Reference in New Issue