mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-24 16:10:14 +00:00
Add upfront validation to CastFailedParser
SMSG_CAST_FAILED (3.3.5a) improvements: - Validate 6-byte minimum for castCount + spellId + result - Prevent reading from truncated packets Ensures consistent error handling for spell failure feedback.
This commit is contained in:
parent
4f3e817913
commit
6e94a3345f
1 changed files with 3 additions and 0 deletions
|
|
@ -3243,6 +3243,9 @@ network::Packet PetActionPacket::build(uint64_t petGuid, uint32_t action, uint64
|
|||
}
|
||||
|
||||
bool CastFailedParser::parse(network::Packet& packet, CastFailedData& data) {
|
||||
// WotLK format: castCount(1) + spellId(4) + result(1) = 6 bytes minimum
|
||||
if (packet.getSize() - packet.getReadPos() < 6) return false;
|
||||
|
||||
data.castCount = packet.readUInt8();
|
||||
data.spellId = packet.readUInt32();
|
||||
data.result = packet.readUInt8();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue