From df4fb8700b298d45bba4af3dba9fad8a00544a7b Mon Sep 17 00:00:00 2001 From: GuEe-GUI <2991707448@qq.com> Date: Tue, 17 Mar 2026 19:39:50 +0800 Subject: [PATCH] [dm][block] fixup the EFI partition checked in 32bits Link: https://github.com/RT-Thread/rt-thread/issues/11260 Signed-off-by: GuEe-GUI <2991707448@qq.com> --- components/drivers/block/partitions/efi.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/drivers/block/partitions/efi.c b/components/drivers/block/partitions/efi.c index a68a1470a1e..22f6ba16591 100644 --- a/components/drivers/block/partitions/efi.c +++ b/components/drivers/block/partitions/efi.c @@ -411,6 +411,11 @@ static rt_bool_t is_gpt_valid(struct rt_blk_disk *disk, pt_size = (rt_uint64_t)rt_le32_to_cpu((*gpt)->num_partition_entries) * rt_le32_to_cpu((*gpt)->sizeof_partition_entry); + if (pt_size > (rt_uint64_t)RT_UINT32_MAX) + { + goto _fail; + } + if (!(*ptes = alloc_read_gpt_entries(disk, *gpt))) { goto _fail;