summaryrefslogtreecommitdiff
path: root/libs/libcurl/src/headers.c
diff options
context:
space:
mode:
Diffstat (limited to 'libs/libcurl/src/headers.c')
-rw-r--r--libs/libcurl/src/headers.c11
1 files changed, 9 insertions, 2 deletions
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;
}