From ba3f47efd67a645c78b0e2d63eaba1ba0fa71cfd Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Thu, 12 Dec 2019 10:37:00 +1100 Subject: [PATCH] bootloader_support: fix crash in image verification is SHA doesn't match --- components/bootloader_support/src/esp_image_format.c | 1 + 1 file changed, 1 insertion(+) diff --git a/components/bootloader_support/src/esp_image_format.c b/components/bootloader_support/src/esp_image_format.c index e44bb94abf..8a22e8209c 100644 --- a/components/bootloader_support/src/esp_image_format.c +++ b/components/bootloader_support/src/esp_image_format.c @@ -222,6 +222,7 @@ static esp_err_t image_load(esp_image_load_mode_t mode, const esp_partition_pos_ // No secure boot, but SHA-256 can be appended for basic corruption detection if (sha_handle != NULL && !esp_cpu_in_ocd_debug_mode()) { err = verify_simple_hash(sha_handle, data); + sha_handle = NULL; // calling verify_simple_hash finishes sha_handle } #endif // SECURE_BOOT_CHECK_SIGNATURE } else { // verify_sha