mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-03 00:03:50 +00:00
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:
parent
d776226fd1
commit
59bbeaca62
4 changed files with 7 additions and 5 deletions
|
|
@ -495,7 +495,7 @@ MountType MountSoundManager::detectMountType(uint32_t creatureDisplayId) const {
|
|||
MountFamily MountSoundManager::detectMountFamilyFromPath(const std::string& modelPath) const {
|
||||
// Convert path to lowercase for matching
|
||||
std::string lower = modelPath;
|
||||
for (char& c : lower) c = std::tolower(c);
|
||||
for (char& c : lower) c = static_cast<char>(std::tolower(static_cast<unsigned char>(c)));
|
||||
|
||||
// Check creature model path for family keywords
|
||||
if (lower.find("tallstrider") != std::string::npos ||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue