fix buffer overflow in mifar ul load (#1697)

Co-authored-by: gornekich <n.gorbadey@gmail.com>
This commit is contained in:
VVX7 2022-09-05 07:42:59 -04:00 committed by GitHub
parent 97b27261d5
commit 8d8481b17f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -195,6 +195,7 @@ bool nfc_device_load_mifare_ul_data(FlipperFormat* file, NfcDevice* dev) {
} }
data->data_size = pages_total * 4; data->data_size = pages_total * 4;
data->data_read = pages_read * 4; data->data_read = pages_read * 4;
if(data->data_size > MF_UL_MAX_DUMP_SIZE || data->data_read > MF_UL_MAX_DUMP_SIZE) break;
bool pages_parsed = true; bool pages_parsed = true;
for(uint16_t i = 0; i < pages_total; i++) { for(uint16_t i = 0; i < pages_total; i++) {
string_printf(temp_str, "Page %d", i); string_printf(temp_str, "Page %d", i);