From 3214fc2f933e37b6697d37e4eeceffbecca42653 Mon Sep 17 00:00:00 2001 From: CTCaer Date: Thu, 18 Jun 2020 01:23:06 +0300 Subject: [PATCH] nyx: Fix validation check for emuMMC restore When checking a partition for enough size for emuMMC restore, always check against the extra 16MB. --- nyx/nyx_gui/frontend/fe_emmc_tools.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nyx/nyx_gui/frontend/fe_emmc_tools.c b/nyx/nyx_gui/frontend/fe_emmc_tools.c index 167c95d..c1e3135 100644 --- a/nyx/nyx_gui/frontend/fe_emmc_tools.c +++ b/nyx/nyx_gui/frontend/fe_emmc_tools.c @@ -61,7 +61,8 @@ static void _get_valid_partition(u32 *sector_start, u32 *sector_size, u32 *part_ curr_part_size = mbr->partitions[i].size_sct; *sector_start = mbr->partitions[i].start_sct; u8 type = mbr->partitions[i].type; - if ((curr_part_size >= *sector_size) && *sector_start && type != 0x83 && (!backup || type == 0xE0)) + u32 sector_size_safe = !backup ? (*sector_size) + 0x8000 : (*sector_size); + if ((curr_part_size >= sector_size_safe) && *sector_start && type != 0x83 && (!backup || type == 0xE0)) { if (backup) {