mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-03 20:03:50 +00:00
fix: tolower/toupper UB on signed char at 10 remaining call sites
Final sweep across mpq_manager, application, auth_screen, wmo_renderer, character_renderer, and terrain_manager. All now use the unsigned char cast pattern. No remaining bare ::tolower/::toupper or std::tolower(c) calls on signed char in the codebase.
This commit is contained in:
parent
34e384e1b2
commit
f02be1ffac
6 changed files with 13 additions and 11 deletions
|
|
@ -454,8 +454,9 @@ void AuthScreen::render(auth::AuthHandler& authHandler) {
|
|||
if (!usingStoredHash) {
|
||||
std::string upperUser = username;
|
||||
std::string upperPass = password;
|
||||
std::transform(upperUser.begin(), upperUser.end(), upperUser.begin(), ::toupper);
|
||||
std::transform(upperPass.begin(), upperPass.end(), upperPass.begin(), ::toupper);
|
||||
auto toUp = [](unsigned char c) { return static_cast<char>(std::toupper(c)); };
|
||||
std::transform(upperUser.begin(), upperUser.end(), upperUser.begin(), toUp);
|
||||
std::transform(upperPass.begin(), upperPass.end(), upperPass.begin(), toUp);
|
||||
std::string combined = upperUser + ":" + upperPass;
|
||||
auto hash = auth::Crypto::sha1(combined);
|
||||
savedPasswordHash = hexEncode(hash);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue