X-Git-Url: https://glassweightruler.freedombox.rocks/gitweb/Ventoy.git/blobdiff_plain/d551fc2e3ca74e4678c744f86c1e8f5e191f624b..d5b829f8e8c8367b032b4bb57a8fc37701d42e17:/GRUB2/grub-2.04/grub-core/fs/fat.c diff --git a/GRUB2/grub-2.04/grub-core/fs/fat.c b/GRUB2/grub-2.04/grub-core/fs/fat.c index 2b26a8c..6338d49 100644 --- a/GRUB2/grub-2.04/grub-core/fs/fat.c +++ b/GRUB2/grub-2.04/grub-core/fs/fat.c @@ -558,7 +558,7 @@ grub_fat_read_data (grub_disk_t disk, grub_fshelp_node_t node, if (next_cluster >= node->data->cluster_eof_mark) return ret; - if (next_cluster < 2 || next_cluster >= node->data->num_clusters) + if (next_cluster < 2 || (next_cluster - 2) >= node->data->num_clusters) { grub_error (GRUB_ERR_BAD_FS, "invalid cluster %u", next_cluster); @@ -1409,7 +1409,7 @@ int grub_fat_get_file_chunk(grub_uint64_t part_start, grub_file_t file, ventoy_i return 0; } - if (next_cluster < 2 || next_cluster >= node->data->num_clusters) + if (next_cluster < 2 || (next_cluster - 2) >= node->data->num_clusters) { grub_error (GRUB_ERR_BAD_FS, "invalid cluster %u", next_cluster); return -1;