Carpet

Carpet

2M Downloads

[bug]If the robot name is too long, the server will collapse

Koch2333 opened this issue ยท 11 comments

commented

Today someone is using "/player" to generate a robot, but the name is too long and the server crashes.
Just use the bot name in "/player (Bot) spawn" with more than ten letters is enough to crash the server.
So now the server has not been connected...
9BE02631-9198-4C74-821A-AA473068EBA7

commented

@Koch2333 You need to update your carpet version, and the problem goes away.

commented

BTW in singleplayer this doesn't happen since the problem here is that there is a limit when decoding the name from a packet, and in singleplayer packets are not encoded.

In current Carpet versions you still can spawn players in singleplayer with names with a length > 16 as long as your are not hosting a LAN server.

commented

I'm closing this issue given it has been resolved.

commented

Also, it may be that Mc doesn't support players which names longer than 10 characters.

The actual limit is 16 characters for a Minecraft account username. Checking on NameMC shows that the username "1234567890123456" is a 16-character valid username associated with an actual Minecraft account, while "12345678901234567" is a 17-character username, which is too long and is therefore invalid.

commented

Try updating carpet version to the latest, as you appear to be on 1.16.4. Also, it may be that Mc doesn't support players which names longer than 10 characters.

commented

This is the reason for the character limitation of the name. Minecraft username has a 16-character limit, but the carpet does not, which caused this bug. I hope the author can fix it.

commented

ah, well it's simple then (I think...). Lemme try fix it.

commented

ah wait a sec, looking at f2e7591, it appears that this issue has already been dealt with since carpet 1.4.38. @Koch2333 you need to update your carpet version, as it was already fixed, but you were running an older version of carpet which didn't have the fix.

commented

I met the same problem, you can summon player with name extends the limit.
and that would make the real players lose connection
image

commented

Are you able to reproduce this problem in a single player environment? For example, running /player abcdefghijklmnopqrstuvwxyz spawn should (according to current behavior) kick you with Internal Exception: io.netty.handler.codec.DecoderException: The received string length is longer than maximum allowed (26 > 16).

commented

Are you able to reproduce this problem in a single player environment? For example, running /player abcdefghijklmnopqrstuvwxyz spawn should (according to current behavior) kick you with Internal Exception: io.netty.handler.codec.DecoderException: The received string length is longer than maximum allowed (26 > 16).

sorry, but I found I'm using an old version carpet