From cc95457c228ea8cb962f52be3a6e5f7fe2c55998 Mon Sep 17 00:00:00 2001 From: "nilesh.kale" Date: Tue, 12 Aug 2025 10:26:14 +0530 Subject: [PATCH] fix(esp_https_ota): fixed missing return check during setting range header This commit added return value check during setting the range header for partial download procedure of esp_https_ota --- components/esp_https_ota/src/esp_https_ota.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/esp_https_ota/src/esp_https_ota.c b/components/esp_https_ota/src/esp_https_ota.c index c958a89d58..f2ef9131ad 100644 --- a/components/esp_https_ota/src/esp_https_ota.c +++ b/components/esp_https_ota/src/esp_https_ota.c @@ -367,6 +367,11 @@ esp_err_t esp_https_ota_begin(const esp_https_ota_config_t *ota_config, esp_http ) { char *header_val = NULL; asprintf(&header_val, "bytes=%d-", https_ota_handle->binary_file_len); + if (header_val == NULL) { + ESP_LOGE(TAG, "Failed to allocate memory for HTTP header"); + err = ESP_ERR_NO_MEM; + goto http_cleanup; + } esp_http_client_set_header(https_ota_handle->http_client, "Range", header_val); free(header_val); }