]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix for Issue 9810. There was a segfault under a specific set of circumstances:
authorMark Michelson <mmichelson@digium.com>
Wed, 6 Jun 2007 19:26:55 +0000 (19:26 +0000)
committerMark Michelson <mmichelson@digium.com>
Wed, 6 Jun 2007 19:26:55 +0000 (19:26 +0000)
1. VoiceMailMain was configured in the dialplan with an extension as its argument
2. A message was left for this mailbox
3. Tried to call VoiceMailMain but hung up before entering password.

This was fixed by checking that a pointer was non-null prior to trying to dereference it.
(Issue 9810, reported by xmarksthespot, patched by Corydon76 with modifications by me).

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67804 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_voicemail.c

index f151c507aed366111c1723241a148cc439984b7c..4e24114c3f6c1e1b73bef3fc13a5db4ba9bfd920 100644 (file)
@@ -4839,11 +4839,13 @@ static int close_mailbox(struct vm_state *vms, struct ast_vm_user *vmu)
        }
        ast_unlock_path(vms->curdir);
 #else
-       for (x=0;x < vmu->maxmsg;x++) { 
-               if (vms->deleted[x]) { 
-                       if(option_debug > 2)
-                               ast_log(LOG_DEBUG,"IMAP delete of %d\n",x);
-                       IMAP_DELETE(vms->curdir, x, vms->fn, vms);
+       if (vms->deleted) {
+               for (x=0;x < vmu->maxmsg;x++) { 
+                       if (vms->deleted[x]) { 
+                               if(option_debug > 2)
+                                       ast_log(LOG_DEBUG,"IMAP delete of %d\n",x);
+                               IMAP_DELETE(vms->curdir, x, vms->fn, vms);
+                       }
                }
        }
 #endif