From: Philippe Antoine Date: Mon, 5 Apr 2021 13:53:09 +0000 (+0200) Subject: http2: pass data through when decompression fails X-Git-Tag: suricata-6.0.3~43 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6109855bca860c294ee696136cc8b9ef92355196;p=thirdparty%2Fsuricata.git http2: pass data through when decompression fails as is done for HTTP1 (cherry picked from commit 1ca4f041bb452742f326985479fca9a02473649f) --- diff --git a/rust/src/http2/decompression.rs b/rust/src/http2/decompression.rs index 205b527a14..518a8e3201 100644 --- a/rust/src/http2/decompression.rs +++ b/rust/src/http2/decompression.rs @@ -172,10 +172,24 @@ impl HTTP2DecoderHalf { ) -> io::Result<&'a [u8]> { match self.decoder { HTTP2Decompresser::GZIP(ref mut gzip_decoder) => { - return http2_decompress(gzip_decoder, input, output); + let r = http2_decompress(gzip_decoder, input, output); + match r { + Err(_) => { + self.decoder = HTTP2Decompresser::UNASSIGNED; + } + _ => {} + } + return r; } HTTP2Decompresser::BROTLI(ref mut br_decoder) => { - return http2_decompress(br_decoder, input, output); + let r = http2_decompress(br_decoder, input, output); + match r { + Err(_) => { + self.decoder = HTTP2Decompresser::UNASSIGNED; + } + _ => {} + } + return r; } _ => {} }