mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 22:03:42 -07:00
fix: wrong size when going to calloc
This commit is contained in:
parent
8c4a42ff36
commit
ba461b8e1b
1 changed files with 4 additions and 3 deletions
|
@ -2554,18 +2554,19 @@ static int CmdResetRead(const char *Cmd) {
|
||||||
|
|
||||||
if (resp.status == PM3_SUCCESS) {
|
if (resp.status == PM3_SUCCESS) {
|
||||||
|
|
||||||
uint8_t *got = calloc(BIGBUF_SIZE - 1, sizeof(uint8_t));
|
uint16_t gotsize = BIGBUF_SIZE - 1;
|
||||||
|
uint8_t *got = calloc(gotsize, sizeof(uint8_t));
|
||||||
if (got == NULL) {
|
if (got == NULL) {
|
||||||
PrintAndLogEx(WARNING, "failed to allocate memory");
|
PrintAndLogEx(WARNING, "failed to allocate memory");
|
||||||
return PM3_EMALLOC;
|
return PM3_EMALLOC;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!GetFromDevice(BIG_BUF, got, sizeof(got), 0, NULL, 0, NULL, 2500, false)) {
|
if (!GetFromDevice(BIG_BUF, got, gotsize, 0, NULL, 0, NULL, 2500, false)) {
|
||||||
PrintAndLogEx(WARNING, "command execution time out");
|
PrintAndLogEx(WARNING, "command execution time out");
|
||||||
free(got);
|
free(got);
|
||||||
return PM3_ETIMEOUT;
|
return PM3_ETIMEOUT;
|
||||||
}
|
}
|
||||||
setGraphBuf(got, sizeof(got));
|
setGraphBuf(got, gotsize);
|
||||||
free(got);
|
free(got);
|
||||||
}
|
}
|
||||||
return PM3_SUCCESS;
|
return PM3_SUCCESS;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue