refactor: convert final 7 getRemainingSize() comparisons to hasRemaining()
Some checks are pending
Build / Build (arm64) (push) Waiting to run
Build / Build (x86-64) (push) Waiting to run
Build / Build (macOS arm64) (push) Waiting to run
Build / Build (windows-arm64) (push) Waiting to run
Build / Build (windows-x86-64) (push) Waiting to run
Security / CodeQL (C/C++) (push) Waiting to run
Security / Semgrep (push) Waiting to run
Security / Sanitizer Build (ASan/UBSan) (push) Waiting to run

Fix extra-paren variants in world_packets and packet_parsers_tbc.
getRemainingSize() is now exclusively arithmetic across the entire
codebase — all bounds checks use hasRemaining().
This commit is contained in:
Kelsi 2026-03-25 16:32:38 -07:00
parent d50bca21c4
commit a491202f93
2 changed files with 6 additions and 6 deletions

View file

@ -912,7 +912,7 @@ bool TbcPacketParsers::parseNameQueryResponse(network::Packet& packet, NameQuery
data.guid = packet.readUInt64();
data.found = 0;
data.name = packet.readString();
if (!data.name.empty() && (packet.getRemainingSize()) >= 12) {
if (!data.name.empty() && packet.hasRemaining(12)) {
uint32_t race = packet.readUInt32();
uint32_t gender = packet.readUInt32();
uint32_t cls = packet.readUInt32();
@ -938,7 +938,7 @@ bool TbcPacketParsers::parseNameQueryResponse(network::Packet& packet, NameQuery
data.found = found;
if (data.found != 0) return true;
data.name = packet.readString();
if (!data.name.empty() && (packet.getRemainingSize()) >= 12) {
if (!data.name.empty() && packet.hasRemaining(12)) {
uint32_t race = packet.readUInt32();
uint32_t gender = packet.readUInt32();
uint32_t cls = packet.readUInt32();