]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix a possible crash in IMAP voicemail.
authorMark Michelson <mmichelson@digium.com>
Fri, 24 Aug 2007 15:51:03 +0000 (15:51 +0000)
committerMark Michelson <mmichelson@digium.com>
Fri, 24 Aug 2007 15:51:03 +0000 (15:51 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80750 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_voicemail.c

index 2b20bd2872d0f4a20ba6a9a591d2a8f0c6029113..4c41ce445c32a219f3a5631bb3b111ee2c815406 100644 (file)
@@ -4421,7 +4421,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");