aimeio-pcsc: soft error for some edge cases

This commit is contained in:
nat 2024-01-11 06:09:14 -08:00
parent b96ad265a2
commit 0fe3a5a471
1 changed files with 2 additions and 4 deletions

View File

@ -78,12 +78,10 @@ HRESULT aime_io_nfc_get_aime_id(
{
assert(luid != NULL);
if (unit_no != 0 || data.card_type != Mifare) {
if (unit_no != 0 || data.card_type != Mifare || luid_size != data.card_id_len) {
return S_FALSE;
}
assert(luid_size == data.card_id_len);
memcpy(luid, data.card_id, luid_size);
return S_OK;
@ -96,7 +94,7 @@ HRESULT aime_io_nfc_get_felica_id(uint8_t unit_no, uint64_t *IDm)
assert(IDm != NULL);
if (unit_no != 0 || data.card_type != FeliCa) {
if (unit_no != 0 || data.card_type != FeliCa || data.card_id_len != 8) {
return S_FALSE;
}