mirror of
https://github.com/curl/curl.git
synced 2024-11-27 05:50:21 +08:00
http2: double http request parser max line length
This works around #11138, by doubling the limit, and should be a relatively safe fix. Ideally the buffer would grow as needed and there would be no need for a limit? But that might be follow-up material. Fixes #11138 Closes #11139
This commit is contained in:
parent
81f3c4bc65
commit
77c9a9845b
@ -33,6 +33,8 @@
|
||||
#define H1_PARSE_OPT_NONE (0)
|
||||
#define H1_PARSE_OPT_STRICT (1 << 0)
|
||||
|
||||
#define H1_PARSE_DEFAULT_MAX_LINE_LEN (8 * 1024)
|
||||
|
||||
struct h1_req_parser {
|
||||
struct http_req *req;
|
||||
struct bufq scratch;
|
||||
|
@ -1860,7 +1860,7 @@ static ssize_t h2_submit(struct stream_ctx **pstream,
|
||||
nghttp2_priority_spec pri_spec;
|
||||
ssize_t nwritten;
|
||||
|
||||
Curl_h1_req_parse_init(&h1, (4*1024));
|
||||
Curl_h1_req_parse_init(&h1, H1_PARSE_DEFAULT_MAX_LINE_LEN);
|
||||
Curl_dynhds_init(&h2_headers, 0, DYN_HTTP_REQUEST);
|
||||
|
||||
*err = http2_data_setup(cf, data, &stream);
|
||||
|
@ -575,7 +575,7 @@ static ssize_t cf_msh3_send(struct Curl_cfilter *cf, struct Curl_easy *data,
|
||||
|
||||
CF_DATA_SAVE(save, cf, data);
|
||||
|
||||
Curl_h1_req_parse_init(&h1, (4*1024));
|
||||
Curl_h1_req_parse_init(&h1, H1_PARSE_DEFAULT_MAX_LINE_LEN);
|
||||
Curl_dynhds_init(&h2_headers, 0, DYN_HTTP_REQUEST);
|
||||
|
||||
/* Sizes must match for cast below to work" */
|
||||
|
@ -1550,7 +1550,7 @@ static ssize_t h3_stream_open(struct Curl_cfilter *cf,
|
||||
nghttp3_data_reader reader;
|
||||
nghttp3_data_reader *preader = NULL;
|
||||
|
||||
Curl_h1_req_parse_init(&h1, (4*1024));
|
||||
Curl_h1_req_parse_init(&h1, H1_PARSE_DEFAULT_MAX_LINE_LEN);
|
||||
Curl_dynhds_init(&h2_headers, 0, DYN_HTTP_REQUEST);
|
||||
|
||||
*err = h3_data_setup(cf, data);
|
||||
|
@ -913,7 +913,7 @@ static ssize_t h3_open_stream(struct Curl_cfilter *cf,
|
||||
DEBUGASSERT(stream);
|
||||
}
|
||||
|
||||
Curl_h1_req_parse_init(&h1, (4*1024));
|
||||
Curl_h1_req_parse_init(&h1, H1_PARSE_DEFAULT_MAX_LINE_LEN);
|
||||
Curl_dynhds_init(&h2_headers, 0, DYN_HTTP_REQUEST);
|
||||
|
||||
DEBUGASSERT(stream);
|
||||
|
Loading…
Reference in New Issue
Block a user