fix mistake

This commit is contained in:
iceman1001
2026-03-31 18:43:37 +07:00
parent bdb05a8037
commit e5385103dc
+11 -9
View File
@@ -727,19 +727,21 @@ static int add_nonce(uint32_t nonce_enc, uint8_t par_enc) {
if (p1 == NULL) { // need to add at the end of the list
if (p2 == NULL) { // list is empty yet. Add first entry.
p2 = nonces[first_byte].first = calloc(1, sizeof(noncelistentry_t));
if (p2 == NULL) {
PrintAndLogEx(WARNING, "Failed to allocate memory");
return PM3_EMALLOC;
}
// first nonce with this 1st byte
first_byte_num++;
first_byte_Sum += evenparity32((nonce_enc & 0xff000000) | (par_enc & 0x08));
} else { // add new entry at end of existing list.
p2 = p2->next = calloc(1, sizeof(noncelistentry_t));
if (p2 == NULL) {
PrintAndLogEx(WARNING, "Failed to allocate memory");
return PM3_EMALLOC;
}
}
if (p2 == NULL) {
PrintAndLogEx(WARNING, "Failed to allocate memory");
return PM3_EMALLOC;
}
// first nonce with this 1st byte
first_byte_num++;
first_byte_Sum += evenparity32((nonce_enc & 0xff000000) | (par_enc & 0x08));
} else if ((p1->nonce_enc & 0x00ff0000) != (nonce_enc & 0x00ff0000)) { // found distinct 2nd byte. Need to insert.
noncelistentry_t *tmp = calloc(1, sizeof(noncelistentry_t));