]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
http2: pass data through when decompression fails 6027/head
authorPhilippe Antoine <contact@catenacyber.fr>
Mon, 5 Apr 2021 13:53:09 +0000 (15:53 +0200)
committerVictor Julien <victor@inliniac.net>
Tue, 6 Apr 2021 11:13:45 +0000 (13:13 +0200)
as is done for HTTP1

rust/src/http2/decompression.rs

index 205b527a1455ce72aee3be9fd4100e307f6aef1f..518a8e320170b7b7395eef211d44c7ec2b71d204 100644 (file)
@@ -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;
             }
             _ => {}
         }