From 8d8481b17fdcd0b2f4303b2e88742a94e980c989 Mon Sep 17 00:00:00 2001 From: VVX7 <46228229+VVX7@users.noreply.github.com> Date: Mon, 5 Sep 2022 07:42:59 -0400 Subject: [PATCH] fix buffer overflow in mifar ul load (#1697) Co-authored-by: gornekich --- lib/nfc/nfc_device.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/nfc/nfc_device.c b/lib/nfc/nfc_device.c index c46919219..ea06ae70f 100644 --- a/lib/nfc/nfc_device.c +++ b/lib/nfc/nfc_device.c @@ -195,6 +195,7 @@ bool nfc_device_load_mifare_ul_data(FlipperFormat* file, NfcDevice* dev) { } data->data_size = pages_total * 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; for(uint16_t i = 0; i < pages_total; i++) { string_printf(temp_str, "Page %d", i);