util/misc.c: Check ftello return value.
Found by: Coverity scan.
This commit is contained in:
parent
5d61a6a612
commit
11eed6abce
1 changed files with 2 additions and 0 deletions
|
@ -89,6 +89,8 @@ grub_util_get_image_size (const char *path)
|
||||||
fseeko (f, 0, SEEK_END);
|
fseeko (f, 0, SEEK_END);
|
||||||
|
|
||||||
sz = ftello (f);
|
sz = ftello (f);
|
||||||
|
if (sz < 0)
|
||||||
|
grub_util_error (_("cannot open `%s': %s"), path, strerror (errno));
|
||||||
if (sz != (size_t) sz)
|
if (sz != (size_t) sz)
|
||||||
grub_util_error (_("file `%s' is too big"), path);
|
grub_util_error (_("file `%s' is too big"), path);
|
||||||
ret = (size_t) sz;
|
ret = (size_t) sz;
|
||||||
|
|
Loading…
Reference in a new issue