]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: mux-h2: Reset padlen when several frames are demux
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 18 Jun 2019 10:22:38 +0000 (12:22 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 19 Jun 2019 08:06:31 +0000 (10:06 +0200)
In the function h2_process_demux(), if several frames are parsed, the padding
length must be reset between each frame. Otherwise we may wrongly think a frame
has a padding block because the previous one was padded.

This patch must be backported to 2.0 and 1.9.

src/mux_h2.c

index d02168df5ae3ee9cf8e3223f03455da6873ac7a6..c06d5d68eddf680c7115be257bff139e7c3c18b0 100644 (file)
@@ -2316,6 +2316,7 @@ static void h2_process_demux(struct h2c *h2c)
                                break;
                        }
 
+                       padlen = 0;
                        if (h2_ft_bit(hdr.ft) & H2_FT_PADDED_MASK && hdr.ff & H2_F_PADDED) {
                                /* If the frame is padded (HEADERS, PUSH_PROMISE or DATA),
                                 * we read the pad length and drop it from the remaining