Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-11-16 21:10:30 +01:00
clear input buffer in case of bad varints
Dieser Commit ist enthalten in:
Ursprung
0cc300b621
Commit
8aad6e2ece
@ -34,6 +34,7 @@ public class MinecraftVarintFrameDecoder extends ByteToMessageDecoder {
|
|||||||
int readVarint = reader.getReadVarint();
|
int readVarint = reader.getReadVarint();
|
||||||
int bytesRead = reader.getBytesRead();
|
int bytesRead = reader.getBytesRead();
|
||||||
if (readVarint < 0) {
|
if (readVarint < 0) {
|
||||||
|
in.clear();
|
||||||
throw BAD_LENGTH_CACHED;
|
throw BAD_LENGTH_CACHED;
|
||||||
} else if (readVarint == 0) {
|
} else if (readVarint == 0) {
|
||||||
// skip over the empty packet and ignore it
|
// skip over the empty packet and ignore it
|
||||||
@ -46,6 +47,7 @@ public class MinecraftVarintFrameDecoder extends ByteToMessageDecoder {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (reader.getResult() == DecodeResult.TOO_BIG) {
|
} else if (reader.getResult() == DecodeResult.TOO_BIG) {
|
||||||
|
in.clear();
|
||||||
throw VARINT_BIG_CACHED;
|
throw VARINT_BIG_CACHED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren