Core/PacketIO: Defined smaller limits for incoming array sizes in client packets (default is 1000)

This commit is contained in:
Shauren
2016-09-06 22:52:32 +02:00
parent 35dcb45252
commit 9b8dbf9281
5 changed files with 8 additions and 5 deletions
+3
View File
@@ -517,6 +517,9 @@ void DB2Manager::LoadStores(std::string const& dataPath, uint32 defaultLocale)
for (ArtifactPowerRankEntry const* artifactPowerRank : sArtifactPowerRankStore)
_artifactPowerRanks[std::pair<uint32, uint8>{ artifactPowerRank->ArtifactPowerID, artifactPowerRank->Rank }] = artifactPowerRank;
ASSERT(BATTLE_PET_SPECIES_MAX_ID >= sBattlePetSpeciesStore.GetNumRows(),
"BATTLE_PET_SPECIES_MAX_ID (%d) must be equal to or greater than %u", BATTLE_PET_SPECIES_MAX_ID, sBattlePetSpeciesStore.GetNumRows());
std::unordered_map<uint32, std::set<std::pair<uint8, uint8>>> addedSections;
for (CharSectionsEntry const* charSection : sCharSectionsStore)
{
+2
View File
@@ -147,6 +147,8 @@ enum ArtifactPowerFlag : uint8
ARTIFACT_POWER_FLAG_DONT_COUNT_FIRST_BONUS_RANK = 0x10,
};
#define BATTLE_PET_SPECIES_MAX_ID 1942
enum ChrSpecializationFlag
{
CHR_SPECIALIZATION_FLAG_CASTER = 0x01,
@@ -281,7 +281,7 @@ namespace WorldPackets
uint8 MaxLevel = 100;
int32 Quality = 0;
uint8 SortCount = 0;
Array<uint8> KnownPets;
Array<uint8, BATTLE_PET_SPECIES_MAX_ID / 8 + 1> KnownPets;
int8 MaxPetLevel;
std::string Name;
Array<ClassFilter, 7> ClassFilters;
@@ -330,10 +330,8 @@ WorldPacket const* WorldPackets::Character::GenerateRandomCharacterNameResult::W
return &_worldPacket;
}
WorldPackets::Character::ReorderCharacters::ReorderCharacters(WorldPacket&& packet) : ClientPacket(CMSG_REORDER_CHARACTERS, std::move(packet)),
Entries(sWorld->getIntConfig(CONFIG_CHARACTERS_PER_REALM))
WorldPackets::Character::ReorderCharacters::ReorderCharacters(WorldPacket&& packet) : ClientPacket(CMSG_REORDER_CHARACTERS, std::move(packet))
{
}
void WorldPackets::Character::ReorderCharacters::Read()
@@ -371,7 +371,7 @@ namespace WorldPackets
void Read() override;
Array<ReorderInfo> Entries;
Array<ReorderInfo, MAX_CHARACTERS_PER_REALM> Entries;
};
class UndeleteCharacter final : public ClientPacket