diff --git a/util/misc.c b/util/misc.c index b0e023ecd..b8ec69108 100644 --- a/util/misc.c +++ b/util/misc.c @@ -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;