aboutsummaryrefslogtreecommitdiff
path: root/src/game/Guild.cpp
diff options
context:
space:
mode:
authorspp <none@none>2009-12-06 17:46:44 +0100
committerspp <none@none>2009-12-06 17:46:44 +0100
commit2acf288071a08682459518f52e0aacdf6131c17d (patch)
tree4d0d94755c3a26d732ed9d24a4f1b08a1d665e1c /src/game/Guild.cpp
parenta914a012fc97ad67c8a535d2afc0f5fd292a8d9b (diff)
Add some checks to prevent guild bank crashes. Closes #646
--HG-- branch : trunk
Diffstat (limited to 'src/game/Guild.cpp')
-rw-r--r--src/game/Guild.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/game/Guild.cpp b/src/game/Guild.cpp
index 62b284c9807..5e1e1409039 100644
--- a/src/game/Guild.cpp
+++ b/src/game/Guild.cpp
@@ -1904,6 +1904,10 @@ uint8 Guild::CanStoreItem( uint8 tab, uint8 slot, GuildItemPosCountVec &dest, ui
if (pItem->IsSoulBound())
return EQUIP_ERR_CANT_DROP_SOULBOUND;
+ // in specific tab
+ if (tab >= m_TabListMap.size() || tab >= GUILD_BANK_MAX_TABS)
+ return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG;
+
// in specific slot
if (slot != NULL_SLOT)
{
@@ -1964,7 +1968,7 @@ void Guild::SetGuildBankTabText(uint8 TabId, std::string text)
void Guild::SendGuildBankTabText(WorldSession *session, uint8 TabId)
{
- if (TabId > GUILD_BANK_MAX_TABS)
+ if (TabId >= GUILD_BANK_MAX_TABS) // tabs starts in 0
return;
GuildBankTab const *tab = GetBankTab(TabId);