projects
/
grub.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5d61a6a
)
util/misc.c: Check ftello return value.
author
Vladimir Serbinenko
<phcoder@gmail.com>
Mon, 26 Jan 2015 08:56:24 +0000
(09:56 +0100)
committer
Vladimir Serbinenko
<phcoder@gmail.com>
Mon, 26 Jan 2015 08:56:24 +0000
(09:56 +0100)
Found by: Coverity scan.
util/misc.c
patch
|
blob
|
history
diff --git
a/util/misc.c
b/util/misc.c
index
b0e023e
..
b8ec691
100644
(file)
--- 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;