fix(Hooking->GetEventData): type char array allocation too small

This commit is contained in:
Yimura 2021-01-01 01:03:15 +01:00
parent 51c0d0b8ee
commit 89151f5dda
No known key found for this signature in database
GPG Key ID: 3D8FF4397E768682

View File

@ -14,7 +14,7 @@ namespace big
Player player = (Player)args[1];
auto hash = args[0];
char type[16] = "";
char type[32] = "";
switch (hash)
{
@ -95,10 +95,14 @@ namespace big
break;
}
for (int64_t kick_hash : kick_hashes)
if (hash == kick_hash)
strcpy(type, "General Kick");
if (strlen(type) != 0)
{
char msg[128];
strcpy(msg, "~g~BLOCKED EVENT~s~\nFrom <C>");
strcpy(msg, "~g~BLOCKED EVENT~s~\nFrom: <C>");
strcat(msg, g_pointers->m_get_player_name(player));
strcat(msg, "</C>\nEvent Type: ~b~");
strcat(msg, type);