mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-03 00:03:50 +00:00
fix(combatlog): validate packed instakill GUIDs
This commit is contained in:
parent
a48f6d1044
commit
0968a11234
1 changed files with 8 additions and 2 deletions
|
|
@ -6430,10 +6430,16 @@ void GameHandler::handlePacket(network::Packet& packet) {
|
||||||
// TBC: full uint64 caster + full uint64 victim + uint32 spellId
|
// TBC: full uint64 caster + full uint64 victim + uint32 spellId
|
||||||
const bool ikUsesFullGuid = isActiveExpansion("tbc");
|
const bool ikUsesFullGuid = isActiveExpansion("tbc");
|
||||||
auto ik_rem = [&]() { return packet.getSize() - packet.getReadPos(); };
|
auto ik_rem = [&]() { return packet.getSize() - packet.getReadPos(); };
|
||||||
if (ik_rem() < (ikUsesFullGuid ? 8u : 1u)) { packet.setReadPos(packet.getSize()); break; }
|
if (ik_rem() < (ikUsesFullGuid ? 8u : 1u)
|
||||||
|
|| (!ikUsesFullGuid && !hasFullPackedGuid(packet))) {
|
||||||
|
packet.setReadPos(packet.getSize()); break;
|
||||||
|
}
|
||||||
uint64_t ikCaster = ikUsesFullGuid
|
uint64_t ikCaster = ikUsesFullGuid
|
||||||
? packet.readUInt64() : UpdateObjectParser::readPackedGuid(packet);
|
? packet.readUInt64() : UpdateObjectParser::readPackedGuid(packet);
|
||||||
if (ik_rem() < (ikUsesFullGuid ? 8u : 1u)) { packet.setReadPos(packet.getSize()); break; }
|
if (ik_rem() < (ikUsesFullGuid ? 8u : 1u)
|
||||||
|
|| (!ikUsesFullGuid && !hasFullPackedGuid(packet))) {
|
||||||
|
packet.setReadPos(packet.getSize()); break;
|
||||||
|
}
|
||||||
uint64_t ikVictim = ikUsesFullGuid
|
uint64_t ikVictim = ikUsesFullGuid
|
||||||
? packet.readUInt64() : UpdateObjectParser::readPackedGuid(packet);
|
? packet.readUInt64() : UpdateObjectParser::readPackedGuid(packet);
|
||||||
uint32_t ikSpell = (ik_rem() >= 4) ? packet.readUInt32() : 0;
|
uint32_t ikSpell = (ik_rem() >= 4) ? packet.readUInt32() : 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue