diff options
author | Mark Michelson <mmichelson@digium.com> | 2008-01-08 20:45:59 +0000 |
---|---|---|
committer | Mark Michelson <mmichelson@digium.com> | 2008-01-08 20:45:59 +0000 |
commit | 190306a23f9d73f3f494e8f19d4a98c66f474886 (patch) | |
tree | 3cf28805b3503db45cce63cd19a9e7c97d3e813c /apps | |
parent | 21fe29f8183b8b0c3c66bdeff54341d179a006a8 (diff) |
Merged revisions 97192 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r97192 | mmichelson | 2008-01-08 14:42:07 -0600 (Tue, 08 Jan 2008) | 9 lines
Making some changes designed to not allow for a corrupted mailstream for a vm_state.
1. Add locking to the vm_state retrieval functions so that no linked list corruption occurs.
2. Make sure to always grab the persistent vm_state when mailstream access is necessary.
3. Correct an incorrect return value in the init_mailstream function.
(closes issue #11304, reported by dwhite)
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@97193 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps')
-rw-r--r-- | apps/app_voicemail.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 09df9423d..4b3104cef 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -2743,11 +2743,11 @@ static int copy_message(struct ast_channel *chan, struct ast_vm_user *vmu, int i { struct vm_state *sendvms = NULL, *destvms = NULL; char messagestring[10]; /*I guess this could be a problem if someone has more than 999999999 messages...*/ - if (!(sendvms = get_vm_state_by_imapuser(vmu->imapuser, 2))) { + if (!(sendvms = get_vm_state_by_imapuser(vmu->imapuser, 0))) { ast_log(LOG_ERROR, "Couldn't get vm_state for originator's mailbox!!\n"); return -1; } - if (!(destvms = get_vm_state_by_imapuser(recip->imapuser, 2))) { + if (!(destvms = get_vm_state_by_imapuser(recip->imapuser, 0))) { ast_log(LOG_ERROR, "Couldn't get vm_state for destination mailbox!\n"); return -1; } @@ -4936,7 +4936,7 @@ static int init_mailstream(struct vm_state *vms, int box) stream = mail_open (stream, tmp, debug ? OP_DEBUG : NIL); if (stream == NIL) { ast_log (LOG_ERROR, "Can't connect to imap server %s\n", tmp); - return NIL; + return -1; } get_mailbox_delimiter(stream); /* update delimiter in imapfolder */ |