Fixed missing arrays

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
This commit is contained in:
Niel Nielsen authored and Philippe Teuwen committed 2026-09-01 17:57:31 +02:00
1 parent 9f0171a706
commit fa8a7da45d
3 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -4445,7 +4445,7 @@ static int mfu_3pass_check_keys(uint8_t key_index, uint8_t firstChunk, uint8_t l
} PACKED;
uint8_t keysize = segment != -1 ? MIFAREU3P_KEY_SIZE / 4 : MIFAREU3P_KEY_SIZE;
memcpy(payload.ref_key, ref_key, MIFAREU3P_KEY_SIZE);
if (nkeys * keysize > sizeof(payload.data)) {
if (nkeys * keysize > (uint32_t)(pm3_max_cmd_data_size() - MIFAREU3P_CHKKEY_HEADER)) {
PrintAndLogEx(ERR, "Key chunk size exceeds payload size");
return PM3_ESOFT;
}
+1 -1
View File
@@ -359,7 +359,7 @@ int CmdLFCommandRead(const char *Cmd) {
memset(payload.symbol_extra, 0, sizeof(payload.symbol_extra));
memset(payload.period_extra, 0, sizeof(payload.period_extra));
if (cmd_len > sizeof(payload.data) - 8 * add_crc_ht - 1) {
if (cmd_len > (size_t)(pm3_max_cmd_data_size() - PAYLOAD_HEADER_SIZE) - 8 * add_crc_ht - 1) {
PrintAndLogEx(ERR, "cmd too long, max length is %zu", sizeof(cmd) - 1);
return PM3_EINVARG;
}
+1 -1
View File
@@ -71,7 +71,7 @@ static int usart_txrx(uint8_t *srcdata, size_t srclen, uint8_t *dstdata, size_t
payload.header.waittime = waittime;
if (srclen >= sizeof(payload.data)) {
if (srclen >= (size_t)(pm3_max_cmd_data_size() - sizeof(uint32_t))) {
return PM3_EOVFLOW;
}