summaryrefslogtreecommitdiffstats
path: root/copy.c
diff options
context:
space:
mode:
authorBrendan Cully <brendan@kublai.com>2008-07-01 13:32:33 -0700
committerBrendan Cully <brendan@kublai.com>2008-07-01 13:32:33 -0700
commitb8a409f222bd24a3bcd6dec87747b2f0053636d3 (patch)
tree385916543f8d416f28f7be5fc917c6b4459e0aa1 /copy.c
parent31acea86f22f8f9711122b8141b5f8e5bb6e7bd9 (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.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/copy.c b/copy.c
index 27b6dfcb..17c5db49 100644
--- a/copy.c
+++ b/copy.c
@@ -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);