Skip to content

Commit

Permalink
Another kafka fix (#1078)
Browse files Browse the repository at this point in the history
Co-authored-by: Conor <conor.brosnan@instaclustr.com>
  • Loading branch information
rukai and conorbros committed Mar 13, 2023
1 parent 4d19376 commit 618c36a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions shotover-proxy/src/codec/kafka.rs
Expand Up @@ -65,10 +65,10 @@ impl KafkaDecoder {
}
}

fn get_length_of_full_message(src: &mut BytesMut) -> Option<usize> {
fn get_length_of_full_message(src: &BytesMut) -> Option<usize> {
if src.len() > 4 {
let size = u32::from_be_bytes(src[0..4].try_into().unwrap()) as usize + 4;
if size >= src.len() {
if size <= src.len() {
Some(size)
} else {
None
Expand Down

0 comments on commit 618c36a

Please sign in to comment.