From: Brendan Cully Date: Mon, 22 Aug 2005 16:10:50 +0000 (+0000) Subject: Don't attempt to manipulate null pgp output file handles. X-Git-Tag: mutt-1-5-11-rel~90 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=93d236c5a6ac3cc8f35fb8c5e50b7a7d5d4c01de;p=mutt Don't attempt to manipulate null pgp output file handles. --- diff --git a/pgp.c b/pgp.c index ac482baa..c8dbe3a0 100644 --- 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); } /*