diff --git a/ChangeLog b/ChangeLog index 4a4a9bf0a..7dcc83ee8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2012-05-06 Vladimir Serbinenko + + * grub-core/fs/affs.c (grub_affs_read_block): Fix theoretical overflow. + 2012-05-06 Vladimir Serbinenko * grub-core/commands/ls.c (grub_ls_list_files): Fix overflow. diff --git a/grub-core/fs/affs.c b/grub-core/fs/affs.c index 50ab8026b..bcb630b6c 100644 --- a/grub-core/fs/affs.c +++ b/grub-core/fs/affs.c @@ -129,8 +129,8 @@ grub_affs_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) if (!node->block_cache) { - node->block_cache = grub_malloc ((((grub_be_to_cpu32 (node->di.size) - + 511) >> 9) / data->htsize + 1) + node->block_cache = grub_malloc (((grub_be_to_cpu32 (node->di.size) + >> 9) / data->htsize + 2) * sizeof (node->block_cache[0])); if (!node->block_cache) return -1;