Reorder checks to prevent malformed packets throwing errors
This commit is contained in:
parent
eaf99cf4a6
commit
340d82812a
@ -271,7 +271,7 @@ public class ServerConnector extends PacketHandler
|
|||||||
throw new IllegalStateException( "May not connect to another BungeCord!" );
|
throw new IllegalStateException( "May not connect to another BungeCord!" );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ( pluginMessage.getData()[0] & 0xFF ) == 0 && pluginMessage.getTag().equals( "FML" ) )
|
if ( pluginMessage.getTag().equals( "FML" ) && ( pluginMessage.getData()[0] & 0xFF ) == 0 )
|
||||||
{
|
{
|
||||||
ByteArrayDataInput in = ByteStreams.newDataInput( pluginMessage.getData() );
|
ByteArrayDataInput in = ByteStreams.newDataInput( pluginMessage.getData() );
|
||||||
in.readUnsignedByte();
|
in.readUnsignedByte();
|
||||||
|
@ -111,7 +111,7 @@ public class UpstreamBridge extends PacketHandler
|
|||||||
throw new CancelSendSignal();
|
throw new CancelSendSignal();
|
||||||
}
|
}
|
||||||
// Hack around Forge race conditions
|
// Hack around Forge race conditions
|
||||||
if ( ( pluginMessage.getData()[0] & 0xFF ) == 1 && pluginMessage.getTag().equals( "FML" ) )
|
if ( pluginMessage.getTag().equals( "FML" ) && ( pluginMessage.getData()[0] & 0xFF ) == 1 )
|
||||||
{
|
{
|
||||||
throw new CancelSendSignal();
|
throw new CancelSendSignal();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user