From 39593e6ae3442babab462c0b94abf6cc8c755146 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Tue, 7 May 2019 10:53:32 +0200 Subject: [PATCH] BUG/MINOR: mux-h1: Fix the parsing of trailers 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mux_h1.c b/src/mux_h1.c index 69a6e2519..6c85c11ae 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -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)