diff options
| author | GuEe-GUI <[email protected]> | 2026-03-17 19:39:50 +0800 |
|---|---|---|
| committer | Rbb666 <[email protected]> | 2026-03-18 21:43:22 +0800 |
| commit | 2b58dec87b584aa7ded6e8c736498716f8d29cd0 (patch) | |
| tree | 3b0029a0dd94d174172590f6e727141d0b976844 | |
| parent | 6a635e32d9f39ea015824927cee492620a05212f (diff) | |
[dm][block] fixup the EFI partition checked in 32bits
Link: https://github.com/RT-Thread/rt-thread/issues/11260
Signed-off-by: GuEe-GUI <[email protected]>
| -rw-r--r-- | components/drivers/block/partitions/efi.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/components/drivers/block/partitions/efi.c b/components/drivers/block/partitions/efi.c index a68a1470a1..22f6ba1659 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; |
