mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 13:53:55 -07:00
fix coverity 286654 wrong sized argument
This commit is contained in:
parent
96108d826a
commit
e2671d5b50
1 changed files with 2 additions and 2 deletions
|
@ -2469,12 +2469,12 @@ static int CmdHF14ADesWriteData(const char *Cmd) {
|
||||||
CLIGetHexWithReturn(3, offset, &offsetlength);
|
CLIGetHexWithReturn(3, offset, &offsetlength);
|
||||||
|
|
||||||
int dlength = 0xFFFF;
|
int dlength = 0xFFFF;
|
||||||
uint8_t *data = (uint8_t *)calloc(0xFFFF, sizeof(uint8_t));
|
uint8_t *data = (uint8_t *)calloc(dlength, sizeof(uint8_t));
|
||||||
if (data == NULL) {
|
if (data == NULL) {
|
||||||
PrintAndLogEx(ERR, "failed to allocate memory");
|
PrintAndLogEx(ERR, "failed to allocate memory");
|
||||||
return PM3_EMALLOC;
|
return PM3_EMALLOC;
|
||||||
}
|
}
|
||||||
if (CLIParamHexToBuf(arg_get_str(4), data, sizeof(data), &dlength)) {
|
if (CLIParamHexToBuf(arg_get_str(4), data, dlength, &dlength)) {
|
||||||
free(data);
|
free(data);
|
||||||
CLIParserFree();
|
CLIParserFree();
|
||||||
return PM3_ESOFT;
|
return PM3_ESOFT;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue