nfc-mfclassic: verify return of nfc_initiator_select_passive_target()

Problem reported by Coverity:
CID 1090323 (#1 of 1): Unchecked return value (CHECKED_RETURN)
  unchecked_value: No check of the return value of "nfc_initiator_select_passive_target(pnd, nmMifare, nt.nti.nai.abtUid, nt.nti.nai.szUidLen, NULL)".
This commit is contained in:
Philippe Teuwen 2013-09-22 02:45:23 +02:00
parent a4f466df06
commit 61884967ea

View file

@ -215,7 +215,10 @@ authenticate(uint32_t uiBlock)
memcpy(mtKeys.amb[uiBlock].mbt.abtKeyB, &mp.mpa.abtKey, 6);
return true;
}
nfc_initiator_select_passive_target(pnd, nmMifare, nt.nti.nai.abtUid, nt.nti.nai.szUidLen, NULL);
if (nfc_initiator_select_passive_target(pnd, nmMifare, nt.nti.nai.abtUid, nt.nti.nai.szUidLen, NULL) <= 0) {
ERR("tag was removed");
return false;
}
}
}