]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
ssh/frames: avoid unsigned integer overflow 11608/head
authorPhilippe Antoine <pantoine@oisf.net>
Fri, 2 Aug 2024 08:42:56 +0000 (10:42 +0200)
committerVictor Julien <victor@inliniac.net>
Tue, 6 Aug 2024 07:55:58 +0000 (09:55 +0200)
Fixes: 0b2ed97f3678 ("ssh: frames support")
rust/src/ssh/ssh.rs

index 1d38a1bd50e1737ce6ca5777b55029ebc666bd78..a6a3871a8e6061c53d6ca968bf47901345a9902a 100644 (file)
@@ -233,7 +233,8 @@ impl SSHState {
                                 flow,
                                 stream_slice,
                                 input,
-                                (head.pkt_len + 4) as i64,
+                                // cast first to avoid unsigned integer overflow
+                                (head.pkt_len as u64 + 4) as i64,
                                 SshFrameType::RecordPdu as u8,
                                 Some(0),
                             );