]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
dns: fix subtraction overflow in debug message
authorJason Ish <jason.ish@oisf.net>
Tue, 4 Aug 2020 19:47:19 +0000 (13:47 -0600)
committerJason Ish <jason.ish@oisf.net>
Tue, 4 Aug 2020 19:58:08 +0000 (13:58 -0600)
The math for the return value wasn't updated in the debug log
to match the logic and could lead to a subtraction overflow

rust/src/dns/dns.rs

index b2731d6f708c98c1fe94a2adbe4aec6c7fcc1c09..cea820a73121455638476a801ae67130a7b23402 100644 (file)
@@ -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);
             }