Improve fml mod list parsing

This commit is contained in:
Nassim Jahnke
2025-01-31 19:11:34 +01:00
parent 91bdcebb1a
commit 6815808d32
2 changed files with 3 additions and 0 deletions

View File

@@ -64,6 +64,7 @@ class LegacyForgeUtil {
if (discriminator == MOD_LIST_DISCRIMINATOR) {
ImmutableList.Builder<ModInfo.Mod> mods = ImmutableList.builder();
int modCount = ProtocolUtils.readVarInt(contents);
Preconditions.checkArgument(modCount < 1024, "Oversized mods list");
for (int index = 0; index < modCount; index++) {
String id = ProtocolUtils.readString(contents);