From 471b40b0f087a87b32af1272f741c3a1b5eb22ef Mon Sep 17 00:00:00 2001 From: Shubham Kulkarni Date: Mon, 6 Apr 2020 13:16:10 +0530 Subject: [PATCH] http_header.c: Add error print in http_header_generate_string if buffer size is less than required size Closes: https://github.com/espressif/esp-idf/issues/5028 --- components/esp_http_client/lib/http_header.c | 1 + 1 file changed, 1 insertion(+) diff --git a/components/esp_http_client/lib/http_header.c b/components/esp_http_client/lib/http_header.c index 4d5e327d6..b3dda8eea 100644 --- a/components/esp_http_client/lib/http_header.c +++ b/components/esp_http_client/lib/http_header.c @@ -191,6 +191,7 @@ int http_header_generate_string(http_header_handle_t header, int index, char *bu if (siz + 1 > *buffer_len - 2) { // if this item would not fit to the buffer, return the index of the last fitting one ret_idx = idx - 1; + ESP_LOGE(TAG, "Buffer length is small to fit all the headers"); break; } }