summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2007-08-24 15:53:36 +0000
committerMark Michelson <mmichelson@digium.com>2007-08-24 15:53:36 +0000
commitca890bae34b8c33a8f911bff94cd261e91a259cf (patch)
treeb83ffb0bc74c68720fe74cb3a4c9a0b5a6f1303c /apps
parentc8d63b4537bc0b2520960984c25582ac9dce404b (diff)
Merged revisions 80750 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r80750 | mmichelson | 2007-08-24 10:51:03 -0500 (Fri, 24 Aug 2007) | 3 lines Fix a possible crash in IMAP voicemail. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@80751 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps')
-rw-r--r--apps/app_voicemail.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 43750ed6c..6c3d1e531 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -4650,7 +4650,7 @@ static int play_message(struct ast_channel *chan, struct ast_vm_user *vmu, struc
mail_fetchstructure (vms->mailstream,vms->msgArray[vms->curmsg],&body);
/* We have the body, now we extract the file name of the first attachment. */
- if (body->nested.part->next && body->nested.part->next->body.parameter->value) {
+ if (body->nested.part && body->nested.part->next && body->nested.part->next->body.parameter->value) {
attachedfilefmt = ast_strdupa(body->nested.part->next->body.parameter->value);
} else {
ast_log(LOG_ERROR, "There is no file attached to this IMAP message.\n");
@@ -5049,7 +5049,7 @@ static int imap_retrieve_file (char *dir, int msgnum, char *mailbox, char *conte
for (i = 0; i < vms_p->mailstream->nmsgs; i++) {
mail_fetchstructure(vms_p->mailstream, i + 1, &body);
/* We have the body, now we extract the file name of the first attachment. */
- if (body->nested.part->next && body->nested.part->next->body.parameter->value) {
+ if (body->nested.part && body->nested.part->next && body->nested.part->next->body.parameter->value) {
attachment = ast_strdupa(body->nested.part->next->body.parameter->value);
} else {
ast_log(LOG_ERROR, "There is no file attached to this IMAP message.\n");