From: Willy Tarreau Date: Thu, 3 Jan 2019 13:50:36 +0000 (+0100) Subject: BUG/MINOR: mux-h2: detect when the HTX EOM block cannot be added after headers X-Git-Tag: v2.0-dev1~286 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b30d0f914eb162479c9c893835f967dde1374c9b;p=thirdparty%2Fhaproxy.git BUG/MINOR: mux-h2: detect when the HTX EOM block cannot be added after headers In case we receive a very large HEADERS frame which doesn't leave enough room to place the EOM block after the decoded headers, we must fail the stream. This test was missing, resulting in the loss of the EOM, possibly leaving the stream waiting for a time-out. Note that we also clear h2c->dfl here so that we don't attempt to clear it twice when going back to the demux. If this is backported to 1.9, it also requires that the following patches are backported as well : MINOR: mux-h2: make h2c_decode_headers() return a status, not a count MINOR: mux-h2: add a new dummy stream : h2_error_stream MEDIUM: mux-h2: make h2c_decode_headers() support recoverable errors --- diff --git a/src/mux_h2.c b/src/mux_h2.c index a06ea5f1e9..3f8ae0d6c1 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -3400,7 +3400,8 @@ next_frame: } if (htx && h2c->dff & H2_F_HEADERS_END_STREAM) - htx_add_endof(htx, HTX_BLK_EOM); + if (!htx_add_endof(htx, HTX_BLK_EOM)) + goto fail; /* success */ ret = 1;