chiark / gitweb /
gpg,common: Make sure that all fd given are valid.
[gnupg2.git] / g10 / cpr.c
index 0133cad314c790cdbcdfe35585bdf624ceffde20..4984e8903c837c4274d5ea7d8848a11833c25e06 100644 (file)
--- a/g10/cpr.c
+++ b/g10/cpr.c
@@ -107,6 +107,9 @@ set_status_fd (int fd)
   if (fd == -1)
     return;
 
+  if (! gnupg_fd_valid (fd))
+    log_fatal ("status-fd is invalid: %s\n", strerror (errno));
+
   if (fd == 1)
     statusfp = es_stdout;
   else if (fd == 2)