BUG/MEDIUM: mux-h2: Reset padlen when several frames are demux

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.
This commit is contained in:
Christopher Faulet 2019-06-18 12:22:38 +02:00
parent 3e2638ee04
commit dd2a5620d5

View File

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