Skip to content

Commit 3ffacb0

Browse files
committed
Merge branch 'bugfix/espcoredump_fix_error_reported_for_blank_partition' into 'master'
espcoredump: fix error reported for blank partition Closes IDF-1727 See merge request espressif/esp-idf!8801
2 parents 5aae08e + 0d85e00 commit 3ffacb0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

components/espcoredump/src/core_dump_flash.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,10 @@ esp_err_t esp_core_dump_image_get(size_t* out_addr, size_t *out_size)
301301
uint32_t *dw = (uint32_t *)core_data;
302302
*out_size = *dw;
303303
spi_flash_munmap(core_data_handle);
304-
if ((*out_size < sizeof(uint32_t)) || (*out_size > core_part->size)) {
304+
if (*out_size == 0xFFFFFFFF) {
305+
ESP_LOGD(TAG, "Blank core dump partition!");
306+
return ESP_ERR_INVALID_SIZE;
307+
} else if ((*out_size < sizeof(uint32_t)) || (*out_size > core_part->size)) {
305308
ESP_LOGE(TAG, "Incorrect size of core dump image: %d", *out_size);
306309
return ESP_ERR_INVALID_SIZE;
307310
}

0 commit comments

Comments
 (0)