fix a chain of calls, where MifareSendCommand uses a 64 byte array and DesfireAPDU uses a memcpy up to 256 bytes

This commit is contained in:
iceman1001
2026-03-24 13:31:51 +07:00
parent 98552b54dc
commit 46ebcb9290
+6 -4
View File
@@ -81,7 +81,7 @@ void MifareSendCommand(uint8_t *datain) {
} PACKED;
struct p *payload = (struct p *) datain;
uint8_t resp[RECEIVE_SIZE];
uint8_t resp[MAX_FRAME_SIZE];
memset(resp, 0, sizeof(resp));
if (g_dbglevel >= DBG_EXTENDED) {
@@ -94,7 +94,7 @@ void MifareSendCommand(uint8_t *datain) {
clear_trace();
if (payload->flags & INIT) {
if (!InitDesfireCard()) {
if (InitDesfireCard() == false) {
return;
}
}
@@ -103,7 +103,7 @@ void MifareSendCommand(uint8_t *datain) {
if (g_dbglevel >= DBG_EXTENDED)
print_result("RESP <--: ", resp, len);
if (!len) {
if (len == 0) {
OnError(2);
return;
}
@@ -697,7 +697,9 @@ int DesfireAPDU(uint8_t *cmd, size_t cmd_len, uint8_t *dataout) {
len = ReaderReceive(resp, sizeof(resp), par);
if (len == 0) {
if (g_dbglevel >= DBG_EXTENDED) Dbprintf("fukked");
if (g_dbglevel >= DBG_EXTENDED) {
Dbprintf("Error: data link failed");
}
return false; //DATA LINK ERROR
}