From: Philippe Antoine Date: Fri, 2 Aug 2024 08:42:56 +0000 (+0200) Subject: ssh/frames: avoid unsigned integer overflow X-Git-Tag: suricata-8.0.0-beta1~956 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a673e1913b34e98840dbfc51c6c969e4cc8add48;p=thirdparty%2Fsuricata.git ssh/frames: avoid unsigned integer overflow Fixes: 0b2ed97f3678 ("ssh: frames support") --- diff --git a/rust/src/ssh/ssh.rs b/rust/src/ssh/ssh.rs index 1d38a1bd50..a6a3871a8e 100644 --- a/rust/src/ssh/ssh.rs +++ b/rust/src/ssh/ssh.rs @@ -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), );