summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2021-07-05 17:13:29 +0200
committerDaniel Stenberg <daniel@haxx.se>2021-07-05 22:49:12 +0200
commita62ece3f57d0097b25a2010056336324d8e4423c (patch)
tree1ea655a5007ea65f77b046de1e1da310b0735fce
parent0965348cd8ebc8dc124a51b3cb8a245063ae656a (diff)
downloadcurl-a62ece3f57d0097b25a2010056336324d8e4423c.tar.gz
c-hyper: bail on too long response headers
To match with built-in behaviors. Makes test 1154 work. Closes #7350
-rw-r--r--lib/c-hyper.c6
-rw-r--r--tests/data/DISABLED2
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/c-hyper.c b/lib/c-hyper.c
index e5b352c99..7a22007ce 100644
--- a/lib/c-hyper.c
+++ b/lib/c-hyper.c
@@ -126,6 +126,12 @@ static int hyper_each_header(void *userdata,
CURLcode result;
int writetype;
+ if(name_len + value_len + 2 > CURL_MAX_HTTP_HEADER) {
+ failf(data, "Too long response header");
+ data->state.hresult = CURLE_OUT_OF_MEMORY;
+ return HYPER_ITER_BREAK;
+ }
+
if(!data->req.bytecount)
Curl_pgrsTime(data, TIMER_STARTTRANSFER);
diff --git a/tests/data/DISABLED b/tests/data/DISABLED
index 7a102b83c..5366e16dc 100644
--- a/tests/data/DISABLED
+++ b/tests/data/DISABLED
@@ -96,8 +96,6 @@
1138
1144
1147
-1151
-1154
1156
1160
1164