mirror of
https://github.com/PaperMC/Velocity.git
synced 2026-02-17 14:37:43 +01:00
Conformity
This commit is contained in:
@@ -76,13 +76,13 @@ public class MinecraftVarintFrameDecoder extends ByteToMessageDecoder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// skip any runs of 0x00 we might find
|
// skip any runs of 0x00 we might find
|
||||||
int wLength = in.readableBytes();
|
int wlen = in.readableBytes();
|
||||||
int packetStart = in.forEachByte(FIND_NON_NUL);
|
int packetStart = in.forEachByte(FIND_NON_NUL);
|
||||||
if (packetStart == -1) {
|
if (packetStart == -1) {
|
||||||
in.clear();
|
in.clear();
|
||||||
// Apply a more strict check in serverbound direction, we really shouldn't be seeing this many 0x00s
|
// Apply a more strict check in serverbound direction, we really shouldn't be seeing this many 0x00s
|
||||||
// even from the server, the only reason we even allow these is due to bugged servers
|
// even from the server, the only reason we even allow these is due to bugged servers
|
||||||
if (direction == ProtocolUtils.Direction.SERVERBOUND && wLength > 16) {
|
if (direction == ProtocolUtils.Direction.SERVERBOUND && wlen > 16) {
|
||||||
throw INVALID_PREAMBLE;
|
throw INVALID_PREAMBLE;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user