diff options
author | Brendan Cully <brendan@kublai.com> | 2008-07-01 13:32:33 -0700 |
---|---|---|
committer | Brendan Cully <brendan@kublai.com> | 2008-07-01 13:32:33 -0700 |
commit | b8a409f222bd24a3bcd6dec87747b2f0053636d3 (patch) | |
tree | 385916543f8d416f28f7be5fc917c6b4459e0aa1 /copy.c | |
parent | 31acea86f22f8f9711122b8141b5f8e5bb6e7bd9 (diff) |
Bail out of copy if decryption is requested but the desired engine is missing.
This closes #2684, but handling of mixed crypto in a single message
needs more investigation.
Diffstat (limited to 'copy.c')
-rw-r--r-- | copy.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -654,7 +654,7 @@ _mutt_copy_message (FILE *fpout, FILE *fpin, HEADER *hdr, BODY *body, else if (WithCrypto && (flags & M_CM_DECODE_CRYPT) && (hdr->security & ENCRYPT)) { - BODY *cur; + BODY *cur = NULL; FILE *fp; if ((WithCrypto & APPLICATION_PGP) @@ -674,6 +674,12 @@ _mutt_copy_message (FILE *fpout, FILE *fpin, HEADER *hdr, BODY *body, return (-1); } + if (!cur) + { + mutt_error (_("No decryption engine available for message")); + return -1; + } + mutt_write_mime_header (cur, fpout); fputc ('\n', fpout); |