add NULL checks

This commit is contained in:
iceman1001 committed 2026-09-15 08:17:05 +02:00
1 parent 57f8613b83
commit a8fcc081b5
3 files changed
+22

No files matched your search

+11
View File
@@ -342,6 +342,11 @@ void loadT55xxConfig(void) {
#ifdef WITH_FLASH
uint8_t *buf = BigBuf_calloc(T55XX_CONFIG_LEN);
if (buf == NULL) {
if (g_dbglevel >= DBG_ERROR) DbpString("loadT55xxConfig: failed to allocate buffer");
BigBuf_free();
return;
}
uint32_t size = 0;
if (exists_in_spiffs(T55XX_CONFIG_FILE)) {
@@ -2948,6 +2953,12 @@ void Cotag(uint32_t arg0, bool ledcontrol) {
}
case 1: {
uint8_t *dest = BigBuf_calloc(COTAG_BITS);
if (dest == NULL) {
if (g_dbglevel >= DBG_ERROR) DbpString("cotag: failed to allocate buffer");
reply_ng(CMD_LF_COTAG_READ, PM3_EMALLOC, NULL, 0);
break;
}
uint16_t bits = doCotagAcquisitionManchester(dest, COTAG_BITS);
reply_ng(CMD_LF_COTAG_READ, PM3_SUCCESS, dest, bits);
break;
+4
View File
@@ -63,6 +63,10 @@ static int sam_set_card_detected_seos(iso14a_card_select_t *card_select) {
uint8_t *response = BigBuf_calloc(ISO7816_MAX_FRAME);
uint16_t response_len = ISO7816_MAX_FRAME;
if (request == NULL || response == NULL) {
res = PM3_EMALLOC;
goto out;
}
const uint8_t payload[] = {
0xa0, 8, // <- SAM command
+7
View File
@@ -930,6 +930,13 @@ void rdv40_spiffs_safe_print_tree(void) {
char *resolvedlink = (char *)BigBuf_calloc(11 + SPIFFS_OBJ_NAME_LEN);
char *linkdest = (char *)BigBuf_calloc(SPIFFS_OBJ_NAME_LEN);
if (resolvedlink == NULL || linkdest == NULL) {
DbpString("Failed to allocate memory");
rdv40_spiffs_lazy_mount_rollback(changed);
BigBuf_free();
return;
}
bool printed = false;
SPIFFS_opendir(&fs, "/", &d);