]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
mqtt: Improve frame parsing w/mult. PDUs
authorJeff Lucovsky <jlucovsky@oisf.net>
Wed, 3 Jan 2024 14:28:41 +0000 (09:28 -0500)
committerVictor Julien <victor@inliniac.net>
Wed, 14 Feb 2024 16:19:35 +0000 (17:19 +0100)
This commit improves the mqtt parsing of frames to handle multiple PDUs.

Issue: 6592

rust/src/mqtt/mqtt.rs

index fbf03e19af69883ca5e1ea8fe617fc052d17c0f4..3b09e4423cf842535c631cf43b4370167c5de8a4 100644 (file)
@@ -433,8 +433,8 @@ impl MQTTState {
                     let _pdu = Frame::new(
                         flow,
                         &stream_slice,
-                        input,
-                        current.len() as i64,
+                        current,
+                        (current.len() - rem.len()) as i64,
                         MQTTFrameType::Pdu as u8,
                     );
                     SCLogDebug!("request msg {:?}", msg);
@@ -518,8 +518,8 @@ impl MQTTState {
                     let _pdu = Frame::new(
                         flow,
                         &stream_slice,
-                        input,
-                        input.len() as i64,
+                        current,
+                        (current.len() - rem.len()) as i64,
                         MQTTFrameType::Pdu as u8,
                     );