From 9360e58536535fd88a2653e038f3c0dca390cddb Mon Sep 17 00:00:00 2001 From: Marc Espie Date: Fri, 4 Dec 2015 17:58:06 +0000 Subject: read_hints should also protect against ferror. obvious commit --- usr.bin/tsort/tsort.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'usr.bin/tsort') 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 @@ -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; } -- cgit v1.2.3