]> granicus.if.org Git - neomutt/commitdiff
Change the interface of pgp_decrypt_mime() to enable this
authorThomas Roessler <roessler@does-not-exist.org>
Tue, 8 Sep 1998 19:14:12 +0000 (19:14 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Tue, 8 Sep 1998 19:14:12 +0000 (19:14 +0000)
function to do some sanity checks.

copy.c
pgp.c
recvattach.c

diff --git a/copy.c b/copy.c
index 0697b85f80a10776a14cccd786c8d9b7c7fb5961..24e8c619598593500a467761bc805801686434b8 100644 (file)
--- a/copy.c
+++ b/copy.c
@@ -420,7 +420,7 @@ _mutt_copy_message (FILE *fpout, FILE *fpin, HEADER *hdr, BODY *body,
     BODY *cur;
     FILE *fp;
 
-    if (pgp_decrypt_mime (fpin, &fp, hdr->content->parts->next, &cur))
+    if (pgp_decrypt_mime (fpin, &fp, hdr->content, &cur))
       return (-1);
     fputs ("Mime-Version: 1.0\n", fpout);
     mutt_write_mime_header (cur, fpout);
diff --git a/pgp.c b/pgp.c
index 58d7348b9041eedc1ed14d1e75ad7d503e18f867..e9df7fd519e673ea0aa23060437229e290a66c3f 100644 (file)
--- a/pgp.c
+++ b/pgp.c
@@ -929,6 +929,11 @@ int pgp_decrypt_mime (FILE *fpin, FILE **fpout, BODY *b, BODY **cur)
   
   if(!mutt_is_multipart_encrypted(b))
     return -1;
+
+  if(!b->parts || !b->parts->next)
+    return -1;
+  
+  b = b->parts->next;
   
   memset (&s, 0, sizeof (s));
   s.fpin = fpin;
index ca38524399811480dcb5abc853239f6013214140..a627d16c586507977f8ddbbf4e7a15147dc60ef6 100644 (file)
@@ -813,7 +813,7 @@ void mutt_view_attachments (HEADER *hdr)
   
   if ((hdr->pgp & PGPENCRYPT) && mutt_is_multipart_encrypted(hdr->content))
   {
-    if (pgp_decrypt_mime (msg->fp, &fp, hdr->content->parts->next, &cur))
+    if (pgp_decrypt_mime (msg->fp, &fp, hdr->content, &cur))
     {
       mx_close_message (&msg);
       return;