Просмотр исходного кода

Fix for issue #1019, HardFault on certain types of credit/bank cards. (#1211)

The country_code does not always have extra pad bytes, so incrementing the index by 2 in emv_decode_read_sfi_record() was too much.

Co-authored-by: Gary <gary@x1z.net>
Co-authored-by: gornekich <n.gorbadey@gmail.com>
Gary 3 лет назад
Родитель
Сommit
b4125f1f9c
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      lib/nfc_protocols/emv.c

+ 1 - 1
lib/nfc_protocols/emv.c

@@ -292,7 +292,7 @@ static bool emv_decode_read_sfi_record(uint8_t* buff, uint16_t len, EmvApplicati
             i += 2;
         } else if(emv_decode_search_tag_u16_r(EMV_TAG_COUNTRY_CODE, buff, &i)) {
             app->country_code = (buff[i] << 8) | buff[i + 1];
-            i += 2;
+            i += 1;
         }
     }