mojira.dev

0x06

Assigned

No issues.

Comments

What are the gameplay effects? Can this issue be reproduced in the game?

There are no major gameplay effects as far as I know.
Yes, this can be reproduced with the following steps: 

Prerequisites/Assumptions:

  • connected to a server (it can be an integrated server)

  • the client and server are both in ConnectionProtocol.PLAY

1. Create a String named "s" with the following data:

// longer than ServerboundCustomPayloadPacket.MAX_PAYLOAD_SIZE when encoded
String s = "\u2603".repeat(FriendlyByteBuf.MAX_STRING_LENGTH);

2. Send a payload with the following arguments:

  • channel: "minecraft:brand"

  • data: FriendlyByteBuf.writeUTF(s);

3. Send another payload with the following arguments (if possible):

  • channel: "this_channel_could_be:any_other_unregistered_channel"

  • data: FriendlyByteBuf.writeUTF(s);

Observed Behavior:
The first payload gets accepted without any problems, the second one makes the server throw a DecoderException caused by an IllegalArgumentException whose message is in the description of this bug report.

Expected Behaviors:

  • The server throws a DecoderException for the first payload too because the payload is too long.

  • The first payload gets accepted without any problems, the second one makes the server throw a DecoderException caused by an IllegalArgumentException with another message because the current one is a little misleading.