mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2024-12-22 20:17:24 +08:00
fix(script_event_handler): fix crash (#3105)
This commit is contained in:
parent
cb78d9a868
commit
db371a3911
@ -453,18 +453,24 @@ namespace big
|
|||||||
case eNetworkEvents::SCRIPTED_GAME_EVENT:
|
case eNetworkEvents::SCRIPTED_GAME_EVENT:
|
||||||
{
|
{
|
||||||
const auto scripted_game_event = std::make_unique<CScriptedGameEvent>();
|
const auto scripted_game_event = std::make_unique<CScriptedGameEvent>();
|
||||||
|
|
||||||
buffer->ReadDword(&scripted_game_event->m_args_size, 32);
|
buffer->ReadDword(&scripted_game_event->m_args_size, 32);
|
||||||
if (scripted_game_event->m_args_size - 1 <= 0x1AF)
|
if (scripted_game_event->m_args_size > sizeof(scripted_game_event->m_args))
|
||||||
buffer->ReadArray(&scripted_game_event->m_args, 8 * scripted_game_event->m_args_size);
|
{
|
||||||
|
notify::crash_blocked(source_player, "out of bounds tse args size");
|
||||||
|
g_pointers->m_gta.m_send_event_ack(event_manager, source_player, target_player, event_index, event_handled_bitset);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
buffer->ReadArray(&scripted_game_event->m_args, 8 * scripted_game_event->m_args_size);
|
||||||
|
|
||||||
if (hooks::scripted_game_event(scripted_game_event.get(), source_player))
|
if (hooks::scripted_game_event(scripted_game_event.get(), source_player))
|
||||||
{
|
{
|
||||||
g_pointers->m_gta.m_send_event_ack(event_manager, source_player, target_player, event_index, event_handled_bitset);
|
g_pointers->m_gta.m_send_event_ack(event_manager, source_player, target_player, event_index, event_handled_bitset);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
buffer->Seek(0);
|
|
||||||
|
|
||||||
|
buffer->Seek(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case eNetworkEvents::NETWORK_CLEAR_PED_TASKS_EVENT:
|
case eNetworkEvents::NETWORK_CLEAR_PED_TASKS_EVENT:
|
||||||
|
Loading…
Reference in New Issue
Block a user