Better check client inventory pos data received in some client packets to skip invalid cases.

This commit is contained in:
VladimirMangos 2008-11-01 21:18:36 +03:00 committed by tomrus88
parent aaddf4b51b
commit e4a2d43a47
4 changed files with 122 additions and 0 deletions

View file

@ -862,6 +862,12 @@ bool ChatHandler::HandleItemMoveCommand(const char* args)
if(srcslot==dstslot)
return true;
if(!m_session->GetPlayer()->IsValidPos(INVENTORY_SLOT_BAG_0,srcslot))
return false;
if(!m_session->GetPlayer()->IsValidPos(INVENTORY_SLOT_BAG_0,dstslot))
return false;
uint16 src = ((INVENTORY_SLOT_BAG_0 << 8) | srcslot);
uint16 dst = ((INVENTORY_SLOT_BAG_0 << 8) | dstslot);