]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
app_voicemail: Clear voice mailbox in MailboxExists and MAILBOX_EXISTS. 86/4186/1
authorJoshua Colp <jcolp@digium.com>
Wed, 26 Oct 2016 12:51:50 +0000 (12:51 +0000)
committerJoshua Colp <jcolp@digium.com>
Wed, 26 Oct 2016 13:16:24 +0000 (08:16 -0500)
When executing the MailboxExists dialplan application and
MAILBOX_EXISTS dialplan function the passed in temporary voice
mailbox was not cleared, causing it to try to free garbage.

ASTERISK-26503 #close

Change-Id: Ie21ccfa1b80b9c59318e596f6b8e17da2b5a7cb3

apps/app_voicemail.c

index 4f8302b03c2e9e169e441c40e047b7d6681e2ff1..cc931f1904800aa0d07f2735a46370e0f6c3b894 100644 (file)
@@ -12050,6 +12050,7 @@ static int vm_box_exists(struct ast_channel *chan, const char *data)
                context++;
        }
 
+       memset(&svm, 0, sizeof(svm));
        vmu = find_user(&svm, context, args.mbox);
        if (vmu) {
                pbx_builtin_setvar_helper(chan, "VMBOXEXISTSSTATUS", "SUCCESS");
@@ -12081,6 +12082,7 @@ static int acf_mailbox_exists(struct ast_channel *chan, const char *cmd, char *a
                ast_log(AST_LOG_WARNING, "MAILBOX_EXISTS is deprecated.  Please use ${VM_INFO(%s,exists)} instead.\n", args);
        }
 
+       memset(&svm, 0, sizeof(svm));
        vmu = find_user(&svm, ast_strlen_zero(arg.context) ? "default" : arg.context, arg.mbox);
        ast_copy_string(buf, vmu ? "1" : "0", len);
        free_user(vmu);