aboutsummaryrefslogtreecommitdiff
path: root/src/game/LootHandler.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-08-19 16:26:22 -0500
committermegamage <none@none>2009-08-19 16:26:22 -0500
commite954904e6d0f026254d4ab93c6b4d051cc7253c6 (patch)
tree24374c0508ddd062dccb7b30bb7455eb9a191b3c /src/game/LootHandler.cpp
parentd9ed49749db71f971c650c109d5bc1ce8af5d8ad (diff)
[8378] Use exceptions instead of explicit size checking for each packet Author: arrai
CHECK_PACKET_SIZE was pretty error prone; once it was forgotten mangosd could crash due to the asserts in ByteBuffer.h. That was exploitable by malicious players. Furthermore, there were duplicate checks: Additionally to CHECK_PACKET_SIZE, the ByteBuffer assertions keept an eye on not exceeding the packet boundaries - just to crash the server for sure in such a case. To prevent memory leaks or other undesirable states, please read in every handler all variables _before_ doing any concrete handling. --HG-- branch : trunk
Diffstat (limited to 'src/game/LootHandler.cpp')
-rw-r--r--src/game/LootHandler.cpp8
1 files changed, 0 insertions, 8 deletions
diff --git a/src/game/LootHandler.cpp b/src/game/LootHandler.cpp
index 6b5f22b6a6b..3c1d383e95f 100644
--- a/src/game/LootHandler.cpp
+++ b/src/game/LootHandler.cpp
@@ -34,8 +34,6 @@
void WorldSession::HandleAutostoreLootItemOpcode( WorldPacket & recv_data )
{
- CHECK_PACKET_SIZE(recv_data,1);
-
sLog.outDebug("WORLD: CMSG_AUTOSTORE_LOOT_ITEM");
Player *player = GetPlayer();
uint64 lguid = player->GetLootGUID();
@@ -252,8 +250,6 @@ void WorldSession::HandleLootMoneyOpcode( WorldPacket & /*recv_data*/ )
void WorldSession::HandleLootOpcode( WorldPacket & recv_data )
{
- CHECK_PACKET_SIZE(recv_data,8);
-
sLog.outDebug("WORLD: CMSG_LOOT");
uint64 guid;
@@ -268,8 +264,6 @@ void WorldSession::HandleLootOpcode( WorldPacket & recv_data )
void WorldSession::HandleLootReleaseOpcode( WorldPacket & recv_data )
{
- CHECK_PACKET_SIZE(recv_data,8);
-
sLog.outDebug("WORLD: CMSG_LOOT_RELEASE");
// cheaters can modify lguid to prevent correct apply loot release code and re-loot
@@ -449,8 +443,6 @@ void WorldSession::DoLootRelease( uint64 lguid )
void WorldSession::HandleLootMasterGiveOpcode( WorldPacket & recv_data )
{
- CHECK_PACKET_SIZE(recv_data,8+1+8);
-
uint8 slotid;
uint64 lootguid, target_playerguid;