summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2015-12-04 17:58:06 +0000
committerMarc Espie <espie@cvs.openbsd.org>2015-12-04 17:58:06 +0000
commit9360e58536535fd88a2653e038f3c0dca390cddb (patch)
treef02c8c9579141b5f09d57d9abdc94de485b50a76
parenta0904325567dd0a4ef2d0aaadd9b88b6d5f95f60 (diff)
read_hints should also protect against ferror.
obvious commit
-rw-r--r--usr.bin/tsort/tsort.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/tsort/tsort.c b/usr.bin/tsort/tsort.c
index e82841d7e85..ca9c6fcd9a6 100644
--- a/usr.bin/tsort/tsort.c
+++ b/usr.bin/tsort/tsort.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tsort.c,v 1.32 2015/10/11 23:01:32 espie Exp $ */
+/* $OpenBSD: tsort.c,v 1.33 2015/12/04 17:58:05 espie Exp $ */
/* ex:ts=8 sw=4:
*
* Copyright (c) 1999-2004 Marc Espie <espie@openbsd.org>
@@ -386,6 +386,8 @@ read_hints(FILE *f, struct ohash *h, int quiet, const char *name,
str = e;
}
}
+ if (!feof(f))
+ err(EX_IOERR, "error reading %s", name);
return order;
}