Core/Opcodes: Prevent invalid memory access with custom opcodes

This commit is contained in:
Shocker
2013-02-10 20:20:36 +02:00
parent 6dc9b4cc44
commit 82f7b337b2

View File

@@ -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)
{