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
9746454f54
commit
a513818762
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=266511
@ -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