geforkt von Mirrors/Velocity
Handle partially sent varints better
Dieser Commit ist enthalten in:
Ursprung
b6f1dcc166
Commit
dd2e1ad241
@ -20,7 +20,8 @@ public class MinecraftVarintFrameDecoder extends ByteToMessageDecoder {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!reader.successfulDecode) {
|
if (reader.successfulDecode) {
|
||||||
|
if (reader.readVarint < 0) {
|
||||||
throw BAD_LENGTH_CACHED;
|
throw BAD_LENGTH_CACHED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -33,6 +34,13 @@ public class MinecraftVarintFrameDecoder extends ByteToMessageDecoder {
|
|||||||
reader.reset();
|
reader.reset();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
boolean tooBig = reader.bytesRead > 3;
|
||||||
|
reader.reset();
|
||||||
|
if (tooBig) {
|
||||||
|
throw BAD_LENGTH_CACHED;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren