Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-12-26 00:00:55 +01:00
Increase readComponent string size limit to 262,143 for 1.13-1.20.2 (#1409)
Dieser Commit ist enthalten in:
Ursprung
6100e675af
Commit
67fb3b70a4
@ -54,6 +54,7 @@ import java.util.Map;
|
||||
|
||||
public class ComponentHolder {
|
||||
private static final Logger logger = LogManager.getLogger(ComponentHolder.class);
|
||||
public static final int DEFAULT_MAX_STRING_SIZE = 262143;
|
||||
|
||||
private final ProtocolVersion version;
|
||||
private @MonotonicNonNull Component component;
|
||||
@ -282,6 +283,8 @@ public class ComponentHolder {
|
||||
if (version.noLessThan(ProtocolVersion.MINECRAFT_1_20_3)) {
|
||||
return new ComponentHolder(version,
|
||||
ProtocolUtils.readBinaryTag(buf, version, BinaryTagIO.reader()));
|
||||
} else if (version.noLessThan(ProtocolVersion.MINECRAFT_1_13)) {
|
||||
return new ComponentHolder(version, ProtocolUtils.readString(buf, DEFAULT_MAX_STRING_SIZE));
|
||||
} else {
|
||||
return new ComponentHolder(version, ProtocolUtils.readString(buf));
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren