From 8e8899c90cdf608f543bdbc6504251a51a222d9c Mon Sep 17 00:00:00 2001 From: Philippe Antoine Date: Wed, 29 Sep 2021 17:06:55 +0200 Subject: [PATCH] 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 --- rust/src/http2/http2.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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, &[]) } } -- 2.47.2