util/misc.c: Check ftello return value.

Found by: Coverity scan.
This commit is contained in:
Vladimir Serbinenko 2015-01-26 09:56:24 +01:00
parent 5d61a6a612
commit 11eed6abce
1 changed files with 2 additions and 0 deletions

View File

@ -89,6 +89,8 @@ grub_util_get_image_size (const char *path)
fseeko (f, 0, SEEK_END);
sz = ftello (f);
if (sz < 0)
grub_util_error (_("cannot open `%s': %s"), path, strerror (errno));
if (sz != (size_t) sz)
grub_util_error (_("file `%s' is too big"), path);
ret = (size_t) sz;