mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 14:21:25 +02:00
BUG/MEDIUM: h2: don't try to parse incomplete H1 responses
This situation which must not happen does in fact happen when feeding artificial responses using errorfiles, Lua or an applet. For now it causes the H1 response parser to loop forever trying to get a more complete response. Since it cannot progress, let's return an error.
This commit is contained in:
parent
fccf840cdf
commit
f13ef96e70
@ -2552,10 +2552,10 @@ static int h2s_frt_make_resp_headers(struct h2s *h2s, struct buffer *buf)
|
|||||||
ret = h1_headers_to_hdr_list(bo_ptr(buf), bo_ptr(buf) + buf->o,
|
ret = h1_headers_to_hdr_list(bo_ptr(buf), bo_ptr(buf) + buf->o,
|
||||||
list, sizeof(list)/sizeof(list[0]), h1m);
|
list, sizeof(list)/sizeof(list[0]), h1m);
|
||||||
if (ret <= 0) {
|
if (ret <= 0) {
|
||||||
if (!ret)
|
/* incomplete or invalid response, this is abnormal coming from
|
||||||
goto end; // missing input
|
* haproxy and may only result in a bad errorfile or bad Lua code
|
||||||
|
* so that won't be fixed, raise an error now.
|
||||||
/* Impossible to index the response.
|
*
|
||||||
* FIXME: we should instead add the ability to only return a
|
* FIXME: we should instead add the ability to only return a
|
||||||
* 502 bad gateway. But in theory this is not supposed to
|
* 502 bad gateway. But in theory this is not supposed to
|
||||||
* happen.
|
* happen.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user