Check return value of fstat() (CID 2513). Cannot really fail in the boot
loader, but the check doesn't harm either. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40066 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
a037e9b3d0
commit
9a3d05d795
@ -13,6 +13,7 @@
|
||||
#include <elf32.h>
|
||||
#include <kernel.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
@ -422,7 +423,8 @@ elf_load_image(Directory *directory, const char *path)
|
||||
// check if this file has already been loaded
|
||||
|
||||
struct stat stat;
|
||||
fstat(fd, &stat);
|
||||
if (fstat(fd, &stat) < 0)
|
||||
return errno;
|
||||
|
||||
image = gKernelArgs.preloaded_images;
|
||||
for (; image != NULL; image = image->next) {
|
||||
|
Loading…
Reference in New Issue
Block a user