mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-12 23:53:52 +00:00
fix: migrate 197 unsafe packet bounds checks to hasRemaining/getRemainingSize
All domain handler files used 'packet.getSize() - packet.getReadPos()'
which underflows to ~2^64 when readPos exceeds size (documented in
commit ed63b029). The game_handler.cpp and packet_parsers were migrated
to hasRemaining(N) in an earlier cleanup, but the domain handlers were
created after that migration by the PR #23 split, copying the old
unsafe patterns back in. Now uses hasRemaining(N) for comparisons and
getRemainingSize() for assignments across all 7 handler files.
This commit is contained in:
parent
849542d01d
commit
294c91d84a
7 changed files with 197 additions and 197 deletions
|
|
@ -27,7 +27,7 @@ void ChatHandler::registerOpcodes(DispatchTable& table) {
|
|||
};
|
||||
table[Opcode::SMSG_EMOTE] = [this](network::Packet& packet) {
|
||||
if (owner_.getState() != WorldState::IN_WORLD) return;
|
||||
if (packet.getSize() - packet.getReadPos() < 12) return;
|
||||
if (!packet.hasRemaining(12)) return;
|
||||
uint32_t emoteAnim = packet.readUInt32();
|
||||
uint64_t sourceGuid = packet.readUInt64();
|
||||
if (owner_.emoteAnimCallback_ && sourceGuid != 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue