mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-19 13:28:25 +00:00
Make sure some strings coming from the client are actually null terminated.
This commit is contained in:
+4
-2
@@ -1082,10 +1082,12 @@ void Client::ChannelMessageReceived(uint8 chan_num, uint8 language, uint8 lang_s
|
||||
{
|
||||
// Emotes for Underfoot and later.
|
||||
// crash protection -- cheater
|
||||
if (strlen(message) > 512)
|
||||
message[1023] = '\0';
|
||||
size_t msg_len = strlen(message);
|
||||
if (msg_len > 512)
|
||||
message[512] = '\0';
|
||||
|
||||
EQApplicationPacket* outapp = new EQApplicationPacket(OP_Emote, 4 + strlen(message) + strlen(GetName()) + 2);
|
||||
EQApplicationPacket* outapp = new EQApplicationPacket(OP_Emote, 4 + msg_len + strlen(GetName()) + 2);
|
||||
Emote_Struct* es = (Emote_Struct*)outapp->pBuffer;
|
||||
char *Buffer = (char *)es;
|
||||
Buffer += 4;
|
||||
|
||||
Reference in New Issue
Block a user