diff options
| author | Loki Rautio <lokirautio@gmail.com> | 2026-03-09 04:45:14 -0500 |
|---|---|---|
| committer | Loki Rautio <lokirautio@gmail.com> | 2026-03-09 04:45:14 -0500 |
| commit | d557ca2dfba5ffcca99ceb41b07d149f871964b5 (patch) | |
| tree | 89ef5bd5fdb2a86fe10a5dead65b65bce8aa0a1d /Minecraft.World/BlockRegionUpdatePacket.cpp | |
| parent | 0c4f4599045edad935403e4d79d28f6b9aa95833 (diff) | |
LCEMP RCE fixes
Based on commit d017bfc30a68888bf5c79b23cf5c4f607cf828bf
Diffstat (limited to 'Minecraft.World/BlockRegionUpdatePacket.cpp')
| -rw-r--r-- | Minecraft.World/BlockRegionUpdatePacket.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Minecraft.World/BlockRegionUpdatePacket.cpp b/Minecraft.World/BlockRegionUpdatePacket.cpp index 730ce3ed..b91cf4f8 100644 --- a/Minecraft.World/BlockRegionUpdatePacket.cpp +++ b/Minecraft.World/BlockRegionUpdatePacket.cpp @@ -105,6 +105,12 @@ void BlockRegionUpdatePacket::read(DataInputStream *dis) //throws IOException levelIdx = ( size >> 30 ) & 3; size &= 0x3fffffff; + const int MAX_COMPRESSED_CHUNK_SIZE = 5 * 1024 * 1024; + if (size < 0 || size > MAX_COMPRESSED_CHUNK_SIZE) + { + size = 0; + } + if(size == 0) { buffer = byteArray(); |
