]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
rust: right condition for both uint to be zero
authorPhilippe Antoine <contact@catenacyber.fr>
Mon, 13 Sep 2021 09:22:36 +0000 (11:22 +0200)
committerVictor Julien <vjulien@oisf.net>
Mon, 15 Nov 2021 12:24:49 +0000 (13:24 +0100)
Theay can overflow leading to their addition to be zero

If a NFS read reply indicates a count of 0xFFFFFFFF

Bug: #4680.
(cherry picked from commit 8f8823b6f2b0a26b551397b8b574104bfd37e9f5)

rust/src/filetracker.rs

index 19131b0fb325db91dafbb1f35c28050be413f7e9..4b97a878c8df06f4b6075ad5e81c6d8de68fb6fa 100644 (file)
@@ -179,7 +179,7 @@ impl FileTransferTracker {
             SCLogDebug!("is_gap {} size {} ooo? {}", is_gap, gap_size, self.chunk_is_ooo);
         }
 
-        if self.chunk_left + self.fill_bytes as u32 == 0 {
+        if self.chunk_left == 0 && self.fill_bytes == 0 {
             //SCLogDebug!("UPDATE: nothing to do");
             if self.chunk_is_last == true {
                 SCLogDebug!("last empty chunk, closing");