From 603e52e5b034175060cb9b87669bc87647a55b0d Mon Sep 17 00:00:00 2001 From: Kelsi Date: Wed, 11 Mar 2026 02:51:58 -0700 Subject: [PATCH] fix: add size check and skip WotLK guid suffix in handleCooldownEvent SMSG_COOLDOWN_EVENT in WotLK appends an 8-byte unit guid after the spellId. The handler was reading without a size check and not consuming the trailing guid, which could misalign subsequent reads. --- src/game/game_handler.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index 012aaf5e..d6c6dcad 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -13982,7 +13982,11 @@ void GameHandler::handleSpellCooldown(network::Packet& packet) { } void GameHandler::handleCooldownEvent(network::Packet& packet) { + if (packet.getSize() - packet.getReadPos() < 4) return; uint32_t spellId = packet.readUInt32(); + // WotLK appends the target unit guid (8 bytes) — skip it + if (packet.getSize() - packet.getReadPos() >= 8) + packet.readUInt64(); // Cooldown finished spellCooldowns.erase(spellId); for (auto& slot : actionBar) {