svn commit: r243210 - stable/9/usr.sbin/ndiscvt
Konstantin Belousov
kostikbel at gmail.com
Sun Nov 18 07:08:56 UTC 2012
On Sun, Nov 18, 2012 at 06:21:46AM +0000, Eitan Adler wrote:
> 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);
>
AFAIR fread(3) can return 0 both for error and EOF. In the later case, errno
is meaningless. Is the short read case fatal ?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 834 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/svn-src-stable-9/attachments/20121118/7df95a85/attachment.sig>
More information about the svn-src-stable-9
mailing list