From b4125f1f9cf7c3dca9355b481a7ea2442cc544ee Mon Sep 17 00:00:00 2001 From: Gary Date: Wed, 11 May 2022 06:19:32 -0400 Subject: [PATCH] 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 Co-authored-by: gornekich --- lib/nfc_protocols/emv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/nfc_protocols/emv.c b/lib/nfc_protocols/emv.c index 81a05e35..8e14cf48 100644 --- a/lib/nfc_protocols/emv.c +++ b/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; } }