]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
http2: range: check return value when opening
authorPhilippe Antoine <contact@catenacyber.fr>
Wed, 29 Sep 2021 15:06:55 +0000 (17:06 +0200)
committerVictor Julien <victor@inliniac.net>
Wed, 29 Sep 2021 20:38:43 +0000 (22:38 +0200)
HttpRangeContainerOpenFile can return NULL
so, http2_range_open can set file_range to NULL
And we should check this before calling http2_range_close

rust/src/http2/http2.rs

index c590bd1a805de4bb4d973059a9dc10b65cf26008..99a8d16a1c47a76df26b5ef7a1851e34ae4f1a99 100644 (file)
@@ -224,7 +224,7 @@ impl HTTP2Transaction {
                     match range::http2_parse_content_range(&value) {
                         Ok((_, v)) => {
                             range::http2_range_open(self, &v, flow, sfcm, flags, decompressed);
-                            if over {
+                            if over && self.file_range != std::ptr::null_mut() {
                                 range::http2_range_close(self, files, flags, &[])
                             }
                         }