]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: mux-h1: Fix the parsing of trailers
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 7 May 2019 08:53:32 +0000 (10:53 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 7 May 2019 20:16:41 +0000 (22:16 +0200)
Unlike other H1 parsing functions, the 3rd parameter of the function
h1_measure_trailers() is the maximum number of bytes to read. For others
functions, it is the relative offset where to stop the parsing.

This patch must be backported to 1.9.

src/mux_h1.c

index 69a6e251972133f486e7b2cb58c5c06c2f27013f..6c85c11ae875528b84069750ec19b08a065d8852 100644 (file)
@@ -1219,7 +1219,7 @@ static size_t h1_process_data(struct h1s *h1s, struct h1m *h1m, struct htx *htx,
                                if (h1s->flags & H1S_F_HAVE_I_TLR)
                                        goto skip_tlr_parsing;
 
-                               ret = h1_measure_trailers(buf, *ofs, *ofs + max);
+                               ret = h1_measure_trailers(buf, *ofs, max);
                                if (ret > data_space)
                                        ret = (htx_is_empty(htx) ? -1 : 0);
                                if (ret <= 0)