From c8815b7b63b710e1480d4be759744583e59308e9 Mon Sep 17 00:00:00 2001 From: David Levine Date: Fri, 18 Aug 2017 23:18:15 -0400 Subject: [PATCH] Protect fileno() call against NULL argument. Fix to commit 337b4e616e8f53ba06285b1645e1df9918ed5c16. Thanks to Norm for reporting and Ken for diagnosing the bug. --- uip/mhparse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uip/mhparse.c b/uip/mhparse.c index 74e03a7e..71405616 100644 --- a/uip/mhparse.c +++ b/uip/mhparse.c @@ -2340,7 +2340,7 @@ openExternal (CT ct, CT cb, CE ce, char **file, int *fd) admonish (cachefile, "unable to fopen for reading"); } - *fd = fileno (ce->ce_fp); + *fd = ce->ce_fp ? fileno (ce->ce_fp) : -1; return OK; ready_already: -- 2.56.0