fix coverity findings

This commit is contained in:
iceman1001
2026-07-03 12:38:59 +02:00
parent 07b3491346
commit b18c274612
2 changed files with 9 additions and 2 deletions
+5
View File
@@ -6347,12 +6347,17 @@ static void *brute_thread(void *args_void) {
// prebit matcher.
bool done = false;
for (int w = 0; w < bs->words && !done; w++) {
uint64_t m = match[w];
while (m != 0) {
const int L = __builtin_ctzll(m);
m &= m - 1;
const uint64_t cand = index + (uint64_t)(w * 64 + L);
generate_key_block_inverted(args->startingKey, cand, div_key);
if (doMAC_brute_match_prebit(y_bits2, div_key, args->MAC_TAG2)) {
legbrute_announce(args, div_key);
done = true;
+4 -2
View File
@@ -533,10 +533,12 @@ static int CmdHF14AJookiSim(const char *Cmd) {
// fast push mode
g_conn.block_after_ACK = true;
uint8_t blockwidth = 4, counter = 0, blockno = 0;
uint8_t blockwidth = 4
uint8_t counter = 0;
uint8_t blockno = 0;
// 12 is the size of the struct the fct mf_eml_set_mem_xt uses to transfer to device
uint16_t max_avail_blocks = ((PM3_CMD_DATA_SIZE - 12) / blockwidth) * blockwidth;
uint16_t max_avail_blocks = ((PM3_CMD_DATA_SIZE - 12) / blockwidth);
while (datalen) {
if (datalen == blockwidth) {