fix(pcsc): remove infinite loop and buffer overflow in smart pcsc

This commit is contained in:
achazal
2026-03-24 10:49:59 +01:00
parent 7f09f556d6
commit 033a734ceb
+2 -2
View File
@@ -1312,7 +1312,7 @@ static int CmdPCSC(const char *Cmd) {
}
}
uint8_t res[22] = {0};
uint8_t res[2 + 256] = {0};
res[1] = atrLen;
memcpy(res + 2, atr, atrLen);
mbedtls_net_send(&netCtx, res, 2 + atrLen);
@@ -1393,7 +1393,7 @@ static int CmdPCSC(const char *Cmd) {
// ISO 15.
if (use_contact && IfPm3Iso14443() && smart_select(false, &card) == PM3_SUCCESS) {
if (use_contact && IfPm3Iso14443() && smart_select(false, &card)) {
have_card = true;
card_type = CC_CONTACT;
}