added bounds checking for when the proxmark3 is simulating a ISO14443a tag

This commit is contained in:
iceman1001 2024-09-05 18:38:17 +02:00
commit 7a4bd03cc0
11 changed files with 55 additions and 47 deletions

View file

@ -224,7 +224,7 @@ void RunMod() {
DbpString(_YELLOW_("[ ") "Bluetooth data:" _YELLOW_(" ]"));
Dbhexdump(lenpacket, rpacket, false);
apdulen = iso14_apdu(rpacket, (uint16_t) lenpacket, false, apdubuffer, NULL);
apdulen = iso14_apdu(rpacket, lenpacket, false, apdubuffer, sizeof(apdubuffer), NULL);
DbpString(_YELLOW_("[ ") "Card response:" _YELLOW_(" ]"));
Dbhexdump(apdulen - 2, apdubuffer, false);
@ -298,7 +298,7 @@ void RunMod() {
for (;;) {
LED_B_OFF();
// Clean receive command buffer
if (GetIso14443aCommandFromReader(receivedCmd, receivedCmdPar, &len) == false) {
if (GetIso14443aCommandFromReader(receivedCmd, sizeof(receivedCmd), receivedCmdPar, &len) == false) {
DbpString("Emulator stopped");
retval = PM3_EOPABORTED;
break;