From: Willy Tarreau Date: Mon, 10 Dec 2018 10:08:04 +0000 (+0100) Subject: BUG/MEDIUM: mux-h2: fix encoding of non-GET/POST methods X-Git-Tag: v1.9-dev11~139 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ac77b6f4411aa9438693f80ead8fd183f339dba7;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: mux-h2: fix encoding of non-GET/POST methods Jerome reported that outgoing H2 failed for methods different from GET or POST. It turns out that the HPACK encoding is performed by hand in the outgoing headers encoding function and that the data length was not incremented to cover the literal method value, resulting in a corrupted HEADERS frame. Admittedly this code should move to the generic HPACK code. No backport is needed. --- diff --git a/src/mux_h2.c b/src/mux_h2.c index 49303a5f23..c83230a356 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -4096,6 +4096,7 @@ static size_t h2s_htx_bck_make_req_headers(struct h2s *h2s, struct htx *htx) outbuf.area[outbuf.data++] = 0x42; // indexed name -- name=":method" (idx 2) outbuf.area[outbuf.data++] = meth.len; // method length memcpy(&outbuf.area[outbuf.data], meth.ptr, meth.len); + outbuf.data += meth.len; } else { if (b_space_wraps(&h2c->mbuf))