fix: ::toupper/::tolower UB on signed char at 5 remaining call sites

std::toupper(int) and std::tolower(int) have undefined behavior when
passed a negative value. These sites passed raw signed char without
casting to unsigned char first, unlike the rest of the codebase which
already uses the correct pattern. Affects auth (account names), world
packets, and mount sound path matching.
This commit is contained in:
Kelsi 2026-03-29 19:58:36 -07:00
parent d776226fd1
commit 59bbeaca62
4 changed files with 7 additions and 5 deletions

View file

@ -80,7 +80,7 @@ network::Packet AuthSessionPacket::build(uint32_t build,
// Convert account name to uppercase
std::string upperAccount = accountName;
std::transform(upperAccount.begin(), upperAccount.end(),
upperAccount.begin(), ::toupper);
upperAccount.begin(), [](unsigned char c) { return static_cast<char>(std::toupper(c)); });
LOG_INFO("Building CMSG_AUTH_SESSION for account: ", upperAccount);