Explorar o código

fix buffer overflow in mifar ul load (#1697)

Co-authored-by: gornekich <n.gorbadey@gmail.com>
VVX7 %!s(int64=3) %!d(string=hai) anos
pai
achega
8d8481b17f
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      lib/nfc/nfc_device.c

+ 1 - 0
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);