]> granicus.if.org Git - mutt/commitdiff
Don't attempt to manipulate null pgp output file handles.
authorBrendan Cully <brendan@kublai.com>
Mon, 22 Aug 2005 16:10:50 +0000 (16:10 +0000)
committerBrendan Cully <brendan@kublai.com>
Mon, 22 Aug 2005 16:10:50 +0000 (16:10 +0000)
pgp.c

diff --git a/pgp.c b/pgp.c
index ac482baad1d68bf9de7cc30fea50d625be1c3a2a..c8dbe3a08ddbdeb1944d1de47bd46f35e8c181ec 100644 (file)
--- a/pgp.c
+++ b/pgp.c
@@ -381,8 +381,13 @@ int pgp_application_pgp_handler (BODY *m, STATE *s)
        }
        
         /* treat empty result as sign of failure */
-       rewind (pgpout);
-        if ((c = fgetc (pgpout)) == EOF)
+       if (pgpout)
+       {
+         rewind (pgpout);
+         c = fgetc (pgpout);
+         ungetc (c, pgpout);
+       }
+        if (!pgpout || c == EOF)
        {
           mutt_error _("Could not decrypt PGP message");
           pgp_void_passphrase ();
@@ -390,7 +395,6 @@ int pgp_application_pgp_handler (BODY *m, STATE *s)
           
           goto out;
         }
-       ungetc (c, pgpout);
       }
       
       /*