From efb36d5fc0fe56a98f5795c53dfa109887cd5aae Mon Sep 17 00:00:00 2001 From: mat Date: Mon, 12 Jan 2026 09:38:47 -1030 Subject: fix memory leaks in azalea-protocol --- azalea-protocol/src/read.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'azalea-protocol/src/read.rs') diff --git a/azalea-protocol/src/read.rs b/azalea-protocol/src/read.rs index 664e2593..5ec7f3b9 100644 --- a/azalea-protocol/src/read.rs +++ b/azalea-protocol/src/read.rs @@ -406,6 +406,8 @@ where mod tests { use std::io::Cursor; + use azalea_buf::AzaleaRead as _; + use crate::{packets::game::ClientboundGamePacket, read::deserialize_packet}; #[test] @@ -433,4 +435,23 @@ mod tests { .as_slice(), )); } + #[test] + fn fuzzed_4() { + // memory leak in DataComponentPatch + let _ = deserialize_packet::(&mut Cursor::new( + [94, 94, 70, 52, 0, 6, 0].as_slice(), + )); + } + #[test] + fn fuzzed_5() { + // also a memory leak in DataComponentPatch + let _ = deserialize_packet::(&mut Cursor::new( + [94, 94, 70, 52, 0, 6, 0, 6, 0].as_slice(), + )); + } + #[test] + fn fuzzed_6() { + // memory leak in simdnbt + let _ = simdnbt::owned::Nbt::azalea_read(&mut Cursor::new([10, 10, 0, 0, 0].as_slice())); + } } -- cgit v1.2.3