aboutsummaryrefslogtreecommitdiff
path: root/azalea-protocol/src/read.rs
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2026-01-12 09:38:47 -1030
committermat <git@matdoes.dev>2026-01-13 01:08:53 +0500
commitefb36d5fc0fe56a98f5795c53dfa109887cd5aae (patch)
tree3674f0b53afca4b3f1d58fc0406bcbac552ab961 /azalea-protocol/src/read.rs
parent2310666975d0f7e06f44efa6032c6838f2a33f0c (diff)
downloadazalea-drasl-efb36d5fc0fe56a98f5795c53dfa109887cd5aae.tar.xz
fix memory leaks in azalea-protocol
Diffstat (limited to 'azalea-protocol/src/read.rs')
-rw-r--r--azalea-protocol/src/read.rs21
1 files changed, 21 insertions, 0 deletions
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::<ClientboundGamePacket>(&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::<ClientboundGamePacket>(&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()));
+ }
}