From 8d651e5e998ba2bb77ae45dcab30ecfe9abb52b2 Mon Sep 17 00:00:00 2001 From: "hrushikesh.bhosale" Date: Mon, 2 Dec 2024 13:41:10 +0530 Subject: [PATCH] fix(esp_https_ota): Changed the type of erase size Changed the type of erase size(esp_https_ota.c) from int to uint_32 type, so that it do not overflow. --- components/esp_https_ota/src/esp_https_ota.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/esp_https_ota/src/esp_https_ota.c b/components/esp_https_ota/src/esp_https_ota.c index faf2d4e187..d4d70c63e3 100644 --- a/components/esp_https_ota/src/esp_https_ota.c +++ b/components/esp_https_ota/src/esp_https_ota.c @@ -556,7 +556,7 @@ esp_err_t esp_https_ota_perform(esp_https_ota_handle_t https_ota_handle) esp_err_t err; int data_read; - const int erase_size = handle->bulk_flash_erase ? (handle->image_length > 0 ? handle->image_length : OTA_SIZE_UNKNOWN) : OTA_WITH_SEQUENTIAL_WRITES; + const size_t erase_size = handle->bulk_flash_erase ? (handle->image_length > 0 ? handle->image_length : OTA_SIZE_UNKNOWN) : OTA_WITH_SEQUENTIAL_WRITES; switch (handle->state) { case ESP_HTTPS_OTA_BEGIN: err = esp_ota_begin(handle->partition.staging, erase_size, &handle->update_handle);