summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ndiscvt
diff options
context:
space:
mode:
authoreadler <eadler@FreeBSD.org>2012-11-15 15:05:57 +0000
committereadler <eadler@FreeBSD.org>2012-11-15 15:05:57 +0000
commit4ef8ed60dda2d957faf7e4e1d5ba9e074a6a9702 (patch)
tree88cf4e382260d128d34ec14e0b51e6b99dc0aa5c /usr.sbin/ndiscvt
parent4a9ad09095aed0514115db289736492f0d13ca2d (diff)
downloadFreeBSD-src-4ef8ed60dda2d957faf7e4e1d5ba9e074a6a9702.zip
FreeBSD-src-4ef8ed60dda2d957faf7e4e1d5ba9e074a6a9702.tar.gz
Add a missing check for fread
Approved by: cperciva MFC after: 3 days
Diffstat (limited to 'usr.sbin/ndiscvt')
-rw-r--r--usr.sbin/ndiscvt/ndiscvt.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/usr.sbin/ndiscvt/ndiscvt.c b/usr.sbin/ndiscvt/ndiscvt.c
index 3775a33..7636c4c 100644
--- a/usr.sbin/ndiscvt/ndiscvt.c
+++ b/usr.sbin/ndiscvt/ndiscvt.c
@@ -325,6 +325,8 @@ main(int argc, char *argv[])
rewind (fp);
img = calloc(fsize, 1);
n = fread (img, fsize, 1, fp);
+ if (n == 0)
+ err(1, "reading .SYS file '%s' failed", sysfile);
fclose(fp);
OpenPOWER on IntegriCloud