From 9dd1fb64b7fbe7731dea5a93d530c3dc176f59ce Mon Sep 17 00:00:00 2001 From: GuruSteve Date: Mon, 6 Mar 2023 00:59:48 -0700 Subject: [PATCH] Fixed picopass load save file overrun (#2464) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: あく --- applications/plugins/picopass/picopass_device.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/applications/plugins/picopass/picopass_device.c b/applications/plugins/picopass/picopass_device.c index ec0bc5af8..53778cfb3 100644 --- a/applications/plugins/picopass/picopass_device.c +++ b/applications/plugins/picopass/picopass_device.c @@ -167,6 +167,8 @@ static bool picopass_device_load_data(PicopassDevice* dev, FuriString* path, boo } size_t app_limit = AA1[PICOPASS_CONFIG_BLOCK_INDEX].data[0]; + // Fix for unpersonalized cards that have app_limit set to 0xFF + if(app_limit > PICOPASS_MAX_APP_LIMIT) app_limit = PICOPASS_MAX_APP_LIMIT; for(size_t i = 6; i < app_limit; i++) { furi_string_printf(temp_str, "Block %d", i); if(!flipper_format_read_hex(