fix 'mem spiffs view' and bad file stats retrieval

This commit is contained in:
iceman1001
2021-03-10 10:43:49 +01:00
parent bf49f4432b
commit 1b2091932e
2 changed files with 10 additions and 8 deletions

View File

@@ -497,6 +497,11 @@ static int CmdFlashMemSpiFFSView(const char *Cmd) {
}
uint32_t len = resp.data.asDwords[0];
if (len == 0) {
PrintAndLogEx(ERR, "error, failed to retrieve file stats on SPIFFSS");
return PM3_EFAILED;
}
uint8_t *dump = calloc(len, sizeof(uint8_t));
if (!dump) {
PrintAndLogEx(ERR, "error, cannot allocate memory ");