X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;f=g10%2Fpassphrase.c;h=37abc0f1c766f6b7242aa987e3843921081632be;hb=8efda808bd0bc4430cab1bf4175c71334fcf5e0d;hp=fb4ec4c857ec39e9ac84a09726590ccc3a1f56c2;hpb=b374c9aee5dbcb0fd5a4e53f4ff6ed1c8015fb61;p=gnupg2.git diff --git a/g10/passphrase.c b/g10/passphrase.c index fb4ec4c..37abc0f 100644 --- a/g10/passphrase.c +++ b/g10/passphrase.c @@ -166,6 +166,9 @@ read_passphrase_from_fd( int fd ) int i, len; char *pw; + if (! gnupg_fd_valid (fd)) + log_fatal ("passphrase-fd is invalid: %s\n", strerror (errno)); + if ( !opt.batch && opt.pinentry_mode != PINENTRY_MODE_LOOPBACK) { /* Not used but we have to do a dummy read, so that it won't end up at the begin of the message if the quite usual trick to