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:
parent
0579bf6f18
commit
f25e889c13
1 changed files with 1 additions and 1 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue