#3264: Negative packet ids are also outside of range

This commit is contained in:
Outfluencer 2022-03-09 01:21:07 +01:00 committed by GitHub
parent 7e47490e70
commit a17d8f8a66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -529,7 +529,7 @@ public enum Protocol
{ {
throw new BadPacketException( "Unsupported protocol version " + version ); throw new BadPacketException( "Unsupported protocol version " + version );
} }
if ( id > MAX_PACKET_ID ) if ( id > MAX_PACKET_ID || id < 0 )
{ {
throw new BadPacketException( "Packet with id " + id + " outside of range" ); throw new BadPacketException( "Packet with id " + id + " outside of range" );
} }