]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
files: rust closes files even on 0 length chunk
authorPhilippe Antoine <contact@catenacyber.fr>
Wed, 1 Jul 2020 18:14:27 +0000 (20:14 +0200)
committerVictor Julien <victor@inliniac.net>
Mon, 3 Aug 2020 12:03:04 +0000 (14:03 +0200)
rust/src/filetracker.rs

index 233eefbedfcbd8a383a96aa656ae33a4740d6aa7..ad1402f66c2bd36f18d9f134146dfc786fc0791c 100644 (file)
@@ -184,6 +184,11 @@ impl FileTransferTracker {
 
         if self.chunk_left + self.fill_bytes as u32 == 0 {
             //SCLogDebug!("UPDATE: nothing to do");
+            if self.chunk_is_last == true {
+                SCLogDebug!("last empty chunk, closing");
+                self.close(files, flags);
+                self.chunk_is_last = false;
+            }
             return 0
         } else if self.chunk_left == 0 {
             SCLogDebug!("FILL BYTES {} from prev run", self.fill_bytes);