Fix CID 1215125: fstat(2) returns -1 on error and sets errno. It does

not return the error (oops).
This commit is contained in:
marcel 2014-05-21 17:37:22 +00:00
parent 65627bf1cb
commit f845ed2375

View File

@ -103,14 +103,12 @@ int
scheme_bootcode(int fd)
{
struct stat sb;
int error;
if (scheme->bootcode == 0)
return (ENXIO);
error = fstat(fd, &sb);
if (error)
return (error);
if (fstat(fd, &sb) == -1)
return (errno);
if (sb.st_size > scheme->bootcode)
return (EFBIG);