nfc-tools/libnfc

Bug in nfc_initiator_list_passive_targets()

RA12322 opened this issue · 1 comments

Hello,

If the number of devices processed in nfc_initiator_list_passive_targets() is equal to szTargets then the last processed
device wil be stuck in selected state. This is because of this part of the code:

[...]
memcpy(&(ant[szTargetFound]), &nt, sizeof(nfc_target));
szTargetFound++;
if (szTargets == szTargetFound) {
break;
}
nfc_initiator_deselect_target(pnd);
[...]

nfc_initiator_deselect_target() must be called before the if (szTargets==szTargetFound)...

Best regards,
Rani

OK, you could provide a PR with a patch to fix it. Thanks