]> 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>
Fri, 12 Nov 2021 14:21:07 +0000 (15:21 +0100)
Theay can overflow leading to their addition to be zero

If a NFS read reply indicates a count of 0xFFFFFFFF

Bug: #4680.

rust/src/filetracker.rs

index bf9d5be96f05592dcaabbad7bf637c4991292e27..f9a5c83be362921e7092c5c240fb8497ba6bf64e 100644 (file)
@@ -170,7 +170,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");