From: Philippe Antoine Date: Mon, 13 Sep 2021 09:22:36 +0000 (+0200) Subject: rust: right condition for both uint to be zero X-Git-Tag: suricata-5.0.8~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb3b80ef4e83b6747871c252b808030e660142ce;p=thirdparty%2Fsuricata.git rust: right condition for both uint to be zero 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) --- diff --git a/rust/src/filetracker.rs b/rust/src/filetracker.rs index 69a6096dfc..148b8dc83f 100644 --- a/rust/src/filetracker.rs +++ b/rust/src/filetracker.rs @@ -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"); return 0 } else if self.chunk_left == 0 {