From owner-svn-src-head@FreeBSD.ORG Thu Nov 15 15:05:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AF25A27F; Thu, 15 Nov 2012 15:05:57 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 94C538FC12; Thu, 15 Nov 2012 15:05:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAFF5vrt003748; Thu, 15 Nov 2012 15:05:57 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAFF5vFY003747; Thu, 15 Nov 2012 15:05:57 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211151505.qAFF5vFY003747@svn.freebsd.org> From: Eitan Adler Date: Thu, 15 Nov 2012 15:05:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243074 - head/usr.sbin/ndiscvt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2012 15:05:57 -0000 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);