* grub-core/fs/affs.c (grub_affs_read_block): Fix theoretical overflow.

This commit is contained in:
Vladimir 'phcoder' Serbinenko committed 2012-05-06 16:18:00 +02:00
1 parent 83b2e89cf7
commit 62ace64dd9
2 files changed
+6 -2

No files matched your search

+2 -2
View File
@@ -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;