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

View file

@ -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;