Fix CID 1215125: fstat(2) returns -1 on error and sets errno. It does
not return the error (oops).
This commit is contained in:
parent
65627bf1cb
commit
f845ed2375
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user