aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Server
diff options
context:
space:
mode:
authorclick <none@none>2010-11-07 20:08:52 +0100
committerclick <none@none>2010-11-07 20:08:52 +0100
commit5d4f009a87f6fd187ad3a52c302d992d174a39aa (patch)
tree59ba471d0fa7cc1588c22077c5e0c85590d475db /src/server/game/Server
parent044c003bddd90ee80353fc6b0af05c7034975f4c (diff)
Core/Entities: Fix exploit/crash in inventory-handling (CMSG_OPEN_ITEM) -thanks to leak
(Adds a scrutiny-based check to baghandling: don't allow placing items in bags that are not "usable" as regular bags) --HG-- branch : trunk
Diffstat (limited to 'src/server/game/Server')
-rwxr-xr-xsrc/server/game/Server/Protocol/Handlers/SpellHandler.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp b/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp
index 23f4ac97968..43c3415d45f 100755
--- a/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp
+++ b/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp
@@ -221,6 +221,15 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket)
return;
}
+ // Verify that the bag is an actual bag that can be used "normally"
+ if(!(proto->Flags & ITEM_PROTO_FLAG_OPENABLE))
+ {
+ pUser->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, pItem, NULL);
+ sLog.outError("Possible hacking attempt: Player %s [guid: %u] tried to open item [guid: %u, entry: %u] which is not openable!",
+ pUser->GetName(), pUser->GetGUIDLow(), pItem->GetGUIDLow(), proto->ItemId);
+ return;
+ }
+
// locked item
uint32 lockId = proto->LockID;
if (lockId)