diff options
author | eadler <eadler@FreeBSD.org> | 2012-11-15 15:05:57 +0000 |
---|---|---|
committer | eadler <eadler@FreeBSD.org> | 2012-11-15 15:05:57 +0000 |
commit | 4ef8ed60dda2d957faf7e4e1d5ba9e074a6a9702 (patch) | |
tree | 88cf4e382260d128d34ec14e0b51e6b99dc0aa5c /usr.sbin/ndiscvt | |
parent | 4a9ad09095aed0514115db289736492f0d13ca2d (diff) | |
download | FreeBSD-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.c | 2 |
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); |