mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-19 21:48:25 +00:00
Add some overflow protection for emotes
Clients crash if the emote is too large, despite the client using a 1024 char buffer...
This commit is contained in:
+5
-1
@@ -1080,6 +1080,10 @@ void Client::ChannelMessageReceived(uint8 chan_num, uint8 language, uint8 lang_s
|
||||
case 22:
|
||||
{
|
||||
// Emotes for Underfoot and later.
|
||||
// crash protection -- cheater
|
||||
if (strlen(message) > 512)
|
||||
message[512] = '\0';
|
||||
|
||||
EQApplicationPacket* outapp = new EQApplicationPacket(OP_Emote, 4 + strlen(message) + strlen(GetName()) + 2);
|
||||
Emote_Struct* es = (Emote_Struct*)outapp->pBuffer;
|
||||
char *Buffer = (char *)es;
|
||||
@@ -8087,4 +8091,4 @@ void Client::PlayMP3(const char* fname)
|
||||
strncpy(buf->filename, fname, filename.length());
|
||||
QueuePacket(outapp);
|
||||
safe_delete(outapp);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user