chraft / c-raft

Project has been retired! -- C#raft the open source c# minecraft server
http://www.c-raft.com
GNU Affero General Public License v3.0
102 stars 43 forks source link

Invalid active slot being sent by a client after block placement #171

Closed taugit closed 12 years ago

taugit commented 12 years ago

It seems that the client sends an invalid active slot ID after he places a block (HoldingChange, 0x10 packet). The numbers looks random but they are definetely are out of range of the available slot IDs (like 2578) and it cause the server to crash when you perform any action. Probably it's a temporary client bug, but it could be fixed using the safety check in the ReadHoldingChange() method (PacketHandlers.cs) or even in the OnActiveChanged() method (Inventory.cs).

taugit commented 12 years ago

The issue has been fixed in this commit.