diff options
| author | Shauren <shauren.trinity@gmail.com> | 2016-01-24 15:08:49 +0100 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2016-01-24 15:08:49 +0100 |
| commit | 11ad71e2fc322c8e109ffe8cd8c52332a26048bf (patch) | |
| tree | f687239df163bc312da11e545a57744a7bb4fd10 /src/server/game/Chat | |
| parent | d5b0ffbe9b0c07beb8d0dfc52a6532c2da805285 (diff) | |
Core/Misc: Fixed array out of bounds access when loading locales_achievement_reward, locales_creature_text, locales_gossip_menu_option and skip LOCALE_none when iterating over locales
Diffstat (limited to 'src/server/game/Chat')
| -rw-r--r-- | src/server/game/Chat/ChatLink.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/server/game/Chat/ChatLink.cpp b/src/server/game/Chat/ChatLink.cpp index d2828267662..4eeea1b20cb 100644 --- a/src/server/game/Chat/ChatLink.cpp +++ b/src/server/game/Chat/ChatLink.cpp @@ -230,6 +230,9 @@ bool ItemChatLink::ValidateName(char* buffer, const char* context) { for (uint8 index = LOCALE_koKR; index < TOTAL_LOCALES; ++index) { + if (index == LOCALE_none) + continue; + if (FormatName(index, suffixStrings) == buffer) { res = true; @@ -412,8 +415,13 @@ bool AchievementChatLink::ValidateName(char* buffer, const char* context) ChatLink::ValidateName(buffer, context); for (uint8 locale = LOCALE_enUS; locale < TOTAL_LOCALES; ++locale) + { + if (locale == LOCALE_none) + continue; + if (strcmp(_achievement->Title->Str[locale], buffer) == 0) return true; + } TC_LOG_TRACE("chat.system", "ChatHandler::isValidChatMessage('%s'): linked achievement (id: %u) name wasn't found in any localization", context, _achievement->ID); return false; |
