diff --git a/nbt/src/main/java/net/md_5/bungee/nbt/type/ListTag.java b/nbt/src/main/java/net/md_5/bungee/nbt/type/ListTag.java index b1b591b8..87838329 100644 --- a/nbt/src/main/java/net/md_5/bungee/nbt/type/ListTag.java +++ b/nbt/src/main/java/net/md_5/bungee/nbt/type/ListTag.java @@ -33,6 +33,11 @@ public class ListTag implements TypedTag listType = input.readByte(); int length = input.readInt(); + if ( length < 0 ) + { + throw new NBTFormatException( "ListTag length cannot be negative" ); + } + if ( listType == Tag.END && length > 0 ) { throw new NBTFormatException( "Missing type in ListTag" ); diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java b/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java index 99adad59..82d5f1e8 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java @@ -50,7 +50,7 @@ public class ProtocolConstants public static final int MINECRAFT_1_21_2 = 768; public static final int MINECRAFT_1_21_4 = 769; public static final int MINECRAFT_1_21_5 = 770; - public static final int MINECRAFT_1_21_6 = 1073742076; + public static final int MINECRAFT_1_21_6 = 1073742078; public static final List SUPPORTED_VERSIONS; public static final List SUPPORTED_VERSION_IDS;