]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: mux-h2: fix encoding of non-GET/POST methods
authorWilly Tarreau <w@1wt.eu>
Mon, 10 Dec 2018 10:08:04 +0000 (11:08 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 10 Dec 2018 10:08:04 +0000 (11:08 +0100)
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

index 49303a5f238a808155e18f3f057a84f5c338856e..c83230a3560e67aa2a5326b310f3d52dc92801b6 100644 (file)
@@ -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))