From a62ece3f57d0097b25a2010056336324d8e4423c Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 5 Jul 2021 17:13:29 +0200 Subject: [PATCH] c-hyper: bail on too long response headers To match with built-in behaviors. Makes test 1154 work. Closes #7350 --- lib/c-hyper.c | 6 ++++++ tests/data/DISABLED | 2 -- 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