aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2007-06-06 19:26:55 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2007-06-06 19:26:55 +0000
commit6790f59ff6df6b97cf4d44ff867b7f00d961c458 (patch)
tree2cc2277a7a0585e693fb453b6a3e0ead89c2171e /apps
parent410867c294e190ce9d0b563cb4fe4232b86ed097 (diff)
Fix for Issue 9810. There was a segfault under a specific set of circumstances:
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: http://svn.digium.com/svn/asterisk/branches/1.4@67804 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r--apps/app_voicemail.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index f151c507a..4e24114c3 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -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