From ac77b6f4411aa9438693f80ead8fd183f339dba7 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Mon, 10 Dec 2018 11:08:04 +0100 Subject: [PATCH] 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. --- src/mux_h2.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mux_h2.c b/src/mux_h2.c index 49303a5f2..c83230a35 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)) -- 2.47.3