PRINCE: Fix potential out-of-bounds read (CID 1248502)

Since _opcodes[] has kNumOpcodes elements, kNumOpcodes itself is
not a valid index.
This commit is contained in:
Torbjörn Andersson 2014-10-25 21:02:03 +02:00
parent 0579bf6f18
commit f25e889c13

View file

@ -477,7 +477,7 @@ uint32 Interpreter::step(uint32 opcodePC) {
// Get the current opcode
_lastOpcode = readScript16();
if (_lastOpcode > kNumOpcodes)
if (_lastOpcode >= kNumOpcodes)
error(
"Trying to execute unknown opcode @0x%04X: %02d",
_currentInstruction,