diff options
author | Machiavelli <none@none> | 2009-06-24 20:09:19 +0200 |
---|---|---|
committer | Machiavelli <none@none> | 2009-06-24 20:09:19 +0200 |
commit | 3c40065564859df0da62bcd3591f2ba19d8f34cf (patch) | |
tree | 5b038648be109f800f775e11134c0ded8a5f82b6 | |
parent | 3fcfbffde7297a7ab72024e8b839e0f2d88f1a8e (diff) |
* Crash safety check in Bag::StoreItem by Visagalis/QAston
--HG--
branch : trunk
-rw-r--r-- | src/game/Bag.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/game/Bag.cpp b/src/game/Bag.cpp index 2d58b63c0a9..bd3250ee322 100644 --- a/src/game/Bag.cpp +++ b/src/game/Bag.cpp @@ -159,7 +159,11 @@ void Bag::RemoveItem( uint8 slot, bool /*update*/ ) void Bag::StoreItem( uint8 slot, Item *pItem, bool /*update*/ ) { - assert(slot < MAX_BAG_SIZE); + if(slot > MAX_BAG_SIZE) + { + sLog.outError("Player GUID" UI64FMTD "tried to manipulate packets and crash the server.", GetOwnerGUID()); + return; + } if( pItem ) { |