From a2344fba6723fc4f91ad6aa739b6b4522eff6f22 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 2 Apr 2016 19:12:14 +0200 Subject: Core/DataStores: Fixed creating entries in sEmotesTextSoundMap if passed invalid arguments (also a data race, if done in multiple threads) --- src/server/game/DataStores/DBCStores.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index 6c51c71fe7b..0e9b50d64c5 100644 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -1017,5 +1017,6 @@ ResponseCodes ValidateName(std::string const& name, LocaleConstant locale) EmotesTextSoundEntry const* FindTextSoundEmoteFor(uint32 emote, uint32 race, uint32 gender) { - return sEmotesTextSoundMap[EmotesTextSoundKey(emote, race, gender)]; + auto itr = sEmotesTextSoundMap.find(EmotesTextSoundKey(emote, race, gender)); + return itr != sEmotesTextSoundMap.end() ? itr->second : nullptr; } -- cgit v1.2.3