From 52335706758fc366083067e31bb3d6f5d2ff135a Mon Sep 17 00:00:00 2001 From: Tamipes Date: Sun, 7 Dec 2025 17:14:58 +0100 Subject: [PATCH] fix: don't abort parsing packets if they have larger than 0 size --- src/packets/mod.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/packets/mod.rs b/src/packets/mod.rs index 33ab322..e8dd26b 100644 --- a/src/packets/mod.rs +++ b/src/packets/mod.rs @@ -6,7 +6,6 @@ use tokio::io; use tokio::io::AsyncReadExt; use tokio::io::AsyncWriteExt; use tokio::net::TcpStream; -use tracing::instrument; use crate::types::VarInt; pub mod clientbound; @@ -81,7 +80,7 @@ impl Packet { if data_size > u16::MAX.into() { return Err(ParseError::LengthIsTooBig(length.get_int()).into()); } - if data_size > 0 { + if data_size < 0 { return Err(ParseError::PacketLengthInvalid(length.get_int()).into()); } // TODO: this is a bandaid fix; the above checks *should* make sure the