This commit is contained in:
iceman1001 2020-01-01 21:28:02 +01:00
parent 866df86825
commit fea3185922

View file

@ -490,10 +490,10 @@ int EMVSearchPSE(EMVCommandChannel channel, bool ActivateField, bool LeaveFieldO
for (uint8_t ui = 0x01; ui <= 0x10; ui++) { for (uint8_t ui = 0x01; ui <= 0x10; ui++) {
if (sfidatalen[ui]) { if (sfidatalen[ui]) {
struct tlvdb *tsfi = NULL;
tsfi = tlvdb_parse_multi(sfidata[ui], sfidatalen[ui]); struct tlvdb *tsfi_a = tlvdb_parse_multi(sfidata[ui], sfidatalen[ui]);
if (tsfi) { if (tsfi_a) {
struct tlvdb *tsfitmp = tlvdb_find_path(tsfi, (tlv_tag_t[]) {0x70, 0x61, 0x00}); struct tlvdb *tsfitmp = tlvdb_find_path(tsfi_a, (tlv_tag_t[]) {0x70, 0x61, 0x00});
if (!tsfitmp) { if (!tsfitmp) {
PrintAndLogEx(FAILED, "SFI 0x%02zu doesn't have any records.", sfidatalen[ui]); PrintAndLogEx(FAILED, "SFI 0x%02zu doesn't have any records.", sfidatalen[ui]);
continue; continue;
@ -501,7 +501,7 @@ int EMVSearchPSE(EMVCommandChannel channel, bool ActivateField, bool LeaveFieldO
res = EMVCheckAID(channel, decodeTLV, tsfitmp, tlv); res = EMVCheckAID(channel, decodeTLV, tsfitmp, tlv);
fileFound = true; fileFound = true;
} }
tlvdb_free(tsfi); tlvdb_free(tsfi_a);
} }
} }
} }