mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 02:04:52 +01:00
Core/Opcodes: Prevent invalid memory access with custom opcodes
This commit is contained in:
@@ -733,6 +733,10 @@ int WorldSocket::ProcessIncoming(WorldPacket* new_pct)
|
||||
return -1;
|
||||
}
|
||||
|
||||
// prevent invalid memory access/crash with custom opcodes
|
||||
if (opcode >= NUM_OPCODE_HANDLERS)
|
||||
return 0;
|
||||
|
||||
OpcodeHandler const* handler = opcodeTable[opcode];
|
||||
if (!handler || handler->Status == STATUS_UNHANDLED)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user