2021-10-01 03:27:34 +02:00
|
|
|
From bbcf8ceff1a4dc626dd39f2bc31f6bceae1ac913 Mon Sep 17 00:00:00 2001
|
2021-04-15 19:13:14 +02:00
|
|
|
From: PermisosDev <55111245+PermisosDev@users.noreply.github.com>
|
|
|
|
Date: Thu, 15 Apr 2021 08:34:57 -0300
|
|
|
|
Subject: [PATCH] Check if packetID is invalid.
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java
|
2021-10-01 03:27:34 +02:00
|
|
|
index 91da8ab65..c03e1b513 100644
|
2021-04-15 19:13:14 +02:00
|
|
|
--- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java
|
|
|
|
+++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java
|
2021-05-01 21:42:07 +02:00
|
|
|
@@ -65,7 +65,12 @@ public class MinecraftDecoder extends MessageToMessageDecoder<ByteBuf>
|
2021-04-15 19:13:14 +02:00
|
|
|
|
|
|
|
int packetId = DefinedPacket.readVarInt( in );
|
|
|
|
packetTypeInfo = packetId;
|
|
|
|
-
|
|
|
|
+ // FlameCord Start - Check if packetId is invalid.
|
2021-04-15 19:28:01 +02:00
|
|
|
+ if (packetId < 0 || packetId > Protocol.MAX_PACKET_ID)
|
2021-05-01 21:42:07 +02:00
|
|
|
+ {
|
|
|
|
+ throw new FastDecoderException( "[" + ctx.channel().remoteAddress() + "] <-> MinecraftDecoder received invalid packet #1, id " + packetId );
|
|
|
|
+ }
|
2021-04-15 19:13:14 +02:00
|
|
|
+ // Flamecord End
|
|
|
|
DefinedPacket packet = prot.createPacket( packetId, protocolVersion, supportsForge );
|
|
|
|
if ( packet != null )
|
|
|
|
{
|
|
|
|
--
|
2021-10-01 03:27:34 +02:00
|
|
|
2.32.0.windows.1
|
2021-04-15 19:13:14 +02:00
|
|
|
|