diff --git a/rust/src/http2/http2.rs b/rust/src/http2/http2.rs index c9aee2c969..6917e054cb 100644 --- a/rust/src/http2/http2.rs +++ b/rust/src/http2/http2.rs @@ -832,6 +832,7 @@ impl HTTP2State { let over = head.flags & parser::HTTP2_FLAG_HEADER_EOS != 0; let ftype = head.ftype; let sid = head.stream_id; + let padded = head.flags & parser::HTTP2_FLAG_HEADER_PADDED != 0; if dir == STREAM_TOSERVER { tx.frames_ts.push(HTTP2Frame { header: head, @@ -851,8 +852,12 @@ impl HTTP2State { if index > 0 { let tx_same = &mut self.transactions[index - 1]; let (files, flags) = self.files.get(dir); + let mut dinput = &rem[..hlsafe]; + if padded && rem.len() > 0 && usize::from(rem[0]) < hlsafe{ + dinput = &rem[1..hlsafe - usize::from(rem[0])]; + } match tx_same.decompress( - &rem[..hlsafe], + dinput, dir, sfcm, over, diff --git a/rust/src/http2/parser.rs b/rust/src/http2/parser.rs index cc76f225c3..87ab117a50 100644 --- a/rust/src/http2/parser.rs +++ b/rust/src/http2/parser.rs @@ -610,7 +610,7 @@ pub struct HTTP2FrameHeaders { //end stream pub const HTTP2_FLAG_HEADER_EOS: u8 = 0x1; pub const HTTP2_FLAG_HEADER_END_HEADERS: u8 = 0x4; -const HTTP2_FLAG_HEADER_PADDED: u8 = 0x8; +pub const HTTP2_FLAG_HEADER_PADDED: u8 = 0x8; const HTTP2_FLAG_HEADER_PRIORITY: u8 = 0x20; pub fn http2_parse_frame_headers<'a>(