From: Jason Ish Date: Tue, 4 Aug 2020 19:47:19 +0000 (-0600) Subject: dns: fix subtraction overflow in debug message X-Git-Tag: suricata-6.0.0-beta1~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cc154ce152750aed796df63925c403b1abe8755c;p=thirdparty%2Fsuricata.git dns: fix subtraction overflow in debug message The math for the return value wasn't updated in the debug log to match the logic and could lead to a subtraction overflow --- diff --git a/rust/src/dns/dns.rs b/rust/src/dns/dns.rs index b2731d6f70..cea820a731 100644 --- a/rust/src/dns/dns.rs +++ b/rust/src/dns/dns.rs @@ -566,7 +566,7 @@ impl DNSState { } } else { SCLogDebug!("[request]Not enough DNS traffic to parse. Returning {}/{}", - consumed as u32, (cur_i.len() - consumed) as u32); + consumed as u32, (size + 2) as u32); return AppLayerResult::incomplete(consumed as u32, (size + 2) as u32); }