Skip to content

Commit 2b58dec

Browse files
GuEe-GUIRbb666
authored andcommitted
[dm][block] fixup the EFI partition checked in 32bits
Link: #11260 Signed-off-by: GuEe-GUI <2991707448@qq.com>
1 parent 6a635e3 commit 2b58dec

File tree

1 file changed

+5
-0
lines changed
  • components/drivers/block/partitions

1 file changed

+5
-0
lines changed

components/drivers/block/partitions/efi.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,11 @@ static rt_bool_t is_gpt_valid(struct rt_blk_disk *disk,
411411
pt_size = (rt_uint64_t)rt_le32_to_cpu((*gpt)->num_partition_entries) *
412412
rt_le32_to_cpu((*gpt)->sizeof_partition_entry);
413413

414+
if (pt_size > (rt_uint64_t)RT_UINT32_MAX)
415+
{
416+
goto _fail;
417+
}
418+
414419
if (!(*ptes = alloc_read_gpt_entries(disk, *gpt)))
415420
{
416421
goto _fail;

0 commit comments

Comments
 (0)