Mojira Archive
MC-27517

Bad dimension sent from server crashes the client

Invalid dimension IDs crash the client. WorldServer assumes that anything the server says is immaculate, and increasingly this is not the case.

What I expected to happen was...:
Client would default to dim 0 if the server sent a bad packet

What actually happened was...:
Crash and stack trace:
Time: 7/30/13 12:56 PM
Description: Exception in world tick

java.lang.NullPointerException
at abv.<init>(SourceFile:120)
at bda.<init>(SourceFile:36)
at bct.a(SourceFile:674)
at fg.a(SourceFile:28)
at cn.b(SourceFile:354)
at bct.e(SourceFile:98)
at bda.b(SourceFile:60)
at ats.k(SourceFile:1386)
at ats.S(SourceFile:663)
at ats.d(SourceFile:619)
at net.minecraft.client.main.Main.main(SourceFile:101)

Steps to Reproduce:
I apologize, this bug is hard to reproduce without a modded server, but such servers are widespread, and trusting mod authors is bad. Modding actually tends to make the client more resistant to this bug, although not by much.'
1. Configure a Bukkit or Spigot server with a small plugin to send a packet 0x09 (the respawn packet) to the client with an invalid dimension/environment id. We tested with "18".
2. Start the server and connect a vanilla client to it.
3. Activate the plugin, sending the packet to the client.

Hope this helps. It's an easy fix (one input validation), but it'll smooth things over going towards Workbench. If you don't care about modded servers crashing clients, feel free to ignore and close.

Duplicate

Isaac Ellingson

2013-07-30, 08:30 PM

2017-07-15, 12:43 AM

2013-07-31, 12:53 AM

0

1

Unconfirmed

Minecraft 1.6.2

-