From c4f4a023eac7f7e1687dfd3898a75419a4115c45 Mon Sep 17 00:00:00 2001 From: jackpoz Date: Fri, 4 Apr 2014 22:16:14 +0200 Subject: Core/Chat: Fix valid chat links being handled as invalid MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix a case where valid chat links would have been handled as invalid. This happened if these conditions were true: - the link was a profession and the link name started with the same name of the profession, like spell id 61120 in esES locale "Inscripción de la tormenta de maestro" with profession name "Inscripción" - the profession name was the same for more than 1 locale available, like esES and esMX, or enUS and enGB Restore memmove() instead of memcpy() wrongly replaced in 791130f6faf6294d2cb27bec409d7b4ee855243f , it's unsafe to use memcpy() with overlapping memory regions. --- src/server/game/Chat/ChatLink.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/server') diff --git a/src/server/game/Chat/ChatLink.cpp b/src/server/game/Chat/ChatLink.cpp index 66758930f7f..12f4b082a9c 100644 --- a/src/server/game/Chat/ChatLink.cpp +++ b/src/server/game/Chat/ChatLink.cpp @@ -314,7 +314,8 @@ bool SpellChatLink::ValidateName(char* buffer, const char* context) // found the prefix, remove it to perform spellname validation below // -2 = strlen(": ") uint32 spellNameLength = strlen(buffer) - skillLineNameLength - 2; - memcpy(buffer, buffer + skillLineNameLength + 2, spellNameLength + 1); + memmove(buffer, buffer + skillLineNameLength + 2, spellNameLength + 1); + break; } } } -- cgit v1.2.3