Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Nov 2012 15:05:57 +0000 (UTC)
From:      Eitan Adler <eadler@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r243074 - head/usr.sbin/ndiscvt
Message-ID:  <201211151505.qAFF5vFY003747@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: eadler
Date: Thu Nov 15 15:05:57 2012
New Revision: 243074
URL: http://svnweb.freebsd.org/changeset/base/243074

Log:
  Add a missing check for fread
  
  Approved by:	cperciva
  MFC after:	3 days

Modified:
  head/usr.sbin/ndiscvt/ndiscvt.c

Modified: head/usr.sbin/ndiscvt/ndiscvt.c
==============================================================================
--- head/usr.sbin/ndiscvt/ndiscvt.c	Thu Nov 15 15:05:54 2012	(r243073)
+++ head/usr.sbin/ndiscvt/ndiscvt.c	Thu Nov 15 15:05:57 2012	(r243074)
@@ -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);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201211151505.qAFF5vFY003747>