From 86d1a677fd310d7d90d6f7545c02a4bd68e1d955 Mon Sep 17 00:00:00 2001 From: dartraiden Date: Wed, 4 Jun 2025 09:49:23 +0300 Subject: libcurl: update to 8.14.0 --- libs/libcurl/src/headers.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'libs/libcurl/src/headers.c') diff --git a/libs/libcurl/src/headers.c b/libs/libcurl/src/headers.c index daae4fe45b..821e9e289c 100644 --- a/libs/libcurl/src/headers.c +++ b/libs/libcurl/src/headers.c @@ -29,7 +29,7 @@ #include "strcase.h" #include "sendf.h" #include "headers.h" -#include "strparse.h" +#include "curlx/strparse.h" /* The last 3 #include files should be in this order */ #include "curl_printf.h" @@ -313,6 +313,11 @@ CURLcode Curl_headers_push(struct Curl_easy *data, const char *header, return CURLE_WEIRD_SERVER_REPLY; } } + if(Curl_llist_count(&data->state.httphdrs) >= MAX_HTTP_RESP_HEADER_COUNT) { + failf(data, "Too many response headers, %d is max", + MAX_HTTP_RESP_HEADER_COUNT); + return CURLE_TOO_LARGE; + } hs = calloc(1, sizeof(*hs) + hlen); if(!hs) @@ -331,8 +336,10 @@ CURLcode Curl_headers_push(struct Curl_easy *data, const char *header, Curl_llist_append(&data->state.httphdrs, hs, &hs->node); data->state.prevhead = hs; } - else + else { + failf(data, "Invalid response header"); free(hs); + } return result; } -- cgit v1.2.3