From 54e470e9e09064ce1a92fff69e454c95bf486bf7 Mon Sep 17 00:00:00 2001 From: Erhan Kurubas Date: Tue, 7 May 2024 00:55:17 +0200 Subject: [PATCH] fix(coredump): fix buffer overflow inside esp_core_dump_get_summary Closes https://github.com/espressif/esp-idf/issues/13754 --- components/espcoredump/src/core_dump_elf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/espcoredump/src/core_dump_elf.c b/components/espcoredump/src/core_dump_elf.c index 4f25e83bdb..28d4f9a73b 100644 --- a/components/espcoredump/src/core_dump_elf.c +++ b/components/espcoredump/src/core_dump_elf.c @@ -787,7 +787,7 @@ static void elf_parse_version_info(esp_core_dump_summary_t *summary, void *data) { core_dump_elf_version_info_t *version = (core_dump_elf_version_info_t *)data; summary->core_dump_version = version->version; - memcpy(summary->app_elf_sha256, version->app_elf_sha256, ELF_APP_SHA256_SIZE); + memcpy(summary->app_elf_sha256, version->app_elf_sha256, sizeof(summary->app_elf_sha256)); ESP_COREDUMP_LOGD("Core dump version 0x%x", summary->core_dump_version); ESP_COREDUMP_LOGD("App ELF SHA2 %s", (char *)summary->app_elf_sha256); }