Fixed picopass load save file overrun (#2464)

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
GuruSteve 2023-03-06 00:59:48 -07:00 committed by GitHub
parent c0e0403b44
commit 9dd1fb64b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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]; 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++) { for(size_t i = 6; i < app_limit; i++) {
furi_string_printf(temp_str, "Block %d", i); furi_string_printf(temp_str, "Block %d", i);
if(!flipper_format_read_hex( if(!flipper_format_read_hex(