BUG/MINOR: h1-htx: properly initialize the err_pos field

Trailers are parsed using a temporary h1m struct, likely due to using
distinct h1 parser states. However, the err_pos field that's used to
decide whether or not to enfore option accept-invalid-http-request (or
response) was not initialized in this struct, resulting in using a
random value that may randomly accept or reject a few bad chars. The
impact is very limited in trailers (e.g. no message size is transmitted
there) but we must make sure that the option is respected, at least for
users facing the need for this option there.

The issue was introduced in 2.0 by commit 2d7c5395ed ("MEDIUM: htx:
Add the parsing of trailers of chunked messages"), and the code moved
from mux_h1.c to h1_htx.c in 2.1 with commit 4f0f88a9d0 ("MEDIUM:
mux-h1/h1-htx: move HTX convertion of H1 messages in dedicated file")
so the patch needs to be backported to all stable versions, and the
file adjusted for 2.0.

(cherry picked from commit 44f02d26f05a953ff28be02b74340cb767cab731)
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit c2c0e03f1858cc5828f1c55ab94956cb4547c7c8)
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit 909ddf6cceae9fa3f093b2eaa667f7f2167cf168)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 825750400a54a531675f10ff1638b40f2d1b77df)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 2400364d9c417fb4f1780e585c079af363ffeb0e)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
diff --git a/src/h1_htx.c b/src/h1_htx.c
index 24769f0..8396b54 100644
--- a/src/h1_htx.c
+++ b/src/h1_htx.c
@@ -590,6 +590,7 @@
 		b_slow_realign(srcbuf, trash.area, 0);
 
 	tlr_h1m.flags = (H1_MF_NO_PHDR|H1_MF_HDRS_ONLY);
+	tlr_h1m.err_pos = h1m->err_pos;
 	ret = h1_headers_to_hdr_list(b_peek(srcbuf, ofs), b_tail(srcbuf),
 				     hdrs, sizeof(hdrs)/sizeof(hdrs[0]), &tlr_h1m, NULL);
 	if (ret <= 0) {