svn commit: r243210 - stable/9/usr.sbin/ndiscvt

Eitan Adler eadler at FreeBSD.org
Sun Nov 18 06:21:46 UTC 2012


Author: eadler
Date: Sun Nov 18 06:21:45 2012
New Revision: 243210
URL: http://svnweb.freebsd.org/changeset/base/243210

Log:
  MFC r243074:
  	Add a missing check for fread
  
  Approved by:	cperciva (implicit)

Modified:
  stable/9/usr.sbin/ndiscvt/ndiscvt.c
Directory Properties:
  stable/9/usr.sbin/ndiscvt/   (props changed)

Modified: stable/9/usr.sbin/ndiscvt/ndiscvt.c
==============================================================================
--- stable/9/usr.sbin/ndiscvt/ndiscvt.c	Sun Nov 18 05:19:08 2012	(r243209)
+++ stable/9/usr.sbin/ndiscvt/ndiscvt.c	Sun Nov 18 06:21:45 2012	(r243210)
@@ -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);
 


More information about the svn-src-stable-9 mailing list