From: Philippe Antoine Date: Wed, 29 Sep 2021 15:06:55 +0000 (+0200) Subject: http2: range: check return value when opening X-Git-Tag: suricata-7.0.0-beta1~1321 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8e8899c90cdf608f543bdbc6504251a51a222d9c;p=thirdparty%2Fsuricata.git http2: range: check return value when opening HttpRangeContainerOpenFile can return NULL so, http2_range_open can set file_range to NULL And we should check this before calling http2_range_close --- diff --git a/rust/src/http2/http2.rs b/rust/src/http2/http2.rs index c590bd1a80..99a8d16a1c 100644 --- a/rust/src/http2/http2.rs +++ b/rust/src/http2/http2.rs @@ -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, &[]) } }