mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-08-24 06:55:27 -07:00
FIX: coverty scan defects.
- bigbuf.c is comparision correct (iLen versus numofparity) - cmdhfepa.c resourceleak, add a call to free - cipherutils.c resourceleak, added calls to free
This commit is contained in:
parent
fcb1cdba15
commit
7f6ccd3926
3 changed files with 4 additions and 2 deletions
|
@ -184,7 +184,7 @@ bool RAMFUNC LogTrace(const uint8_t *btBytes, uint16_t iLen, uint32_t timestamp_
|
||||||
traceLen += iLen;
|
traceLen += iLen;
|
||||||
|
|
||||||
// parity bytes
|
// parity bytes
|
||||||
if (iLen != 0) {
|
if (num_paritybytes != 0) {
|
||||||
if (parity != NULL) {
|
if (parity != NULL) {
|
||||||
memcpy(trace + traceLen, parity, num_paritybytes);
|
memcpy(trace + traceLen, parity, num_paritybytes);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -58,13 +58,13 @@ int CmdHFEPACollectPACENonces(const char *Cmd)
|
||||||
}
|
}
|
||||||
// print nonce
|
// print nonce
|
||||||
PrintAndLog("Length: %d, Nonce: %s", nonce_length, nonce);
|
PrintAndLog("Length: %d, Nonce: %s", nonce_length, nonce);
|
||||||
|
free(nonce);
|
||||||
}
|
}
|
||||||
if (i < n - 1) {
|
if (i < n - 1) {
|
||||||
sleep(d);
|
sleep(d);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PrintAndLog("End: %u", time(NULL));
|
PrintAndLog("End: %u", time(NULL));
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -171,6 +171,7 @@ void printarr(char * name, uint8_t* arr, int len)
|
||||||
}
|
}
|
||||||
cx += snprintf(output+cx,outsize-cx,"};");
|
cx += snprintf(output+cx,outsize-cx,"};");
|
||||||
prnlog(output);
|
prnlog(output);
|
||||||
|
free(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
void printvar(char * name, uint8_t* arr, int len)
|
void printvar(char * name, uint8_t* arr, int len)
|
||||||
|
@ -188,6 +189,7 @@ void printvar(char * name, uint8_t* arr, int len)
|
||||||
}
|
}
|
||||||
|
|
||||||
prnlog(output);
|
prnlog(output);
|
||||||
|
free(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
void printarr_human_readable(char * title, uint8_t* arr, int len)
|
void printarr_human_readable(char * title, uint8_t* arr, int len)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue