enforce NULL checks after all malloc, calloc, realloc

This commit is contained in:
iceman1001 committed 2026-03-29 10:20:30 +07:00
1 parent 94720a4a6c
commit ad82c50158
13 files changed
+114 -13

No files matched your search

+4
View File
@@ -373,6 +373,10 @@ static int CmdFlashMemLoad(const char *Cmd) {
uint32_t keycount = 0;
uint8_t keylen = 0;
uint8_t *data = calloc(FLASH_MEM_MAX_SIZE_P(spi_flash_pages), sizeof(uint8_t));
if (data == NULL) {
PrintAndLogEx(WARNING, "Failed to allocate memory");
return PM3_EMALLOC;
}
char spiffsDest[32] = {0};