mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-24 08:09:22 +00:00
* util/misc.c (grub_util_get_image_size): Check for overflow.
This commit is contained in:
1 parent
80b29fc9b4
commit
74763e9615
2 files changed
+9
-1
No files matched your search
@@ -1,3 +1,7 @@
|
||||
2013-12-21 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* util/misc.c (grub_util_get_image_size): Check for overflow.
|
||||
|
||||
2013-12-21 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/disk/raid6_recover.c (grub_raid_block_mulx): Use grub_size_t
|
||||
|
||||
+5
-1
@@ -79,6 +79,7 @@ grub_util_get_image_size (const char *path)
|
||||
{
|
||||
FILE *f;
|
||||
size_t ret;
|
||||
off_t sz;
|
||||
|
||||
f = grub_util_fopen (path, "rb");
|
||||
|
||||
@@ -87,7 +88,10 @@ grub_util_get_image_size (const char *path)
|
||||
|
||||
fseeko (f, 0, SEEK_END);
|
||||
|
||||
ret = ftello (f);
|
||||
sz = ftello (f);
|
||||
if (sz != (size_t) sz)
|
||||
grub_util_error (_("file `%s' is too big"), path);
|
||||
ret = (size_t) sz;
|
||||
|
||||
fclose (f);
|
||||
|
||||
|
||||
Reference in new issue
Block a user