diff options
author | Torbjörn Andersson | 2014-10-25 21:02:03 +0200 |
---|---|---|
committer | Torbjörn Andersson | 2014-10-25 21:02:03 +0200 |
commit | f25e889c13238671c8ce33a95bcf59f82e70c5c3 (patch) | |
tree | 5f3a6dfb7d5d0cef356e4afb6322b54ab6d6f831 /engines | |
parent | 0579bf6f18e56410e1b94e97034c8db774e73b06 (diff) | |
download | scummvm-rg350-f25e889c13238671c8ce33a95bcf59f82e70c5c3.tar.gz scummvm-rg350-f25e889c13238671c8ce33a95bcf59f82e70c5c3.tar.bz2 scummvm-rg350-f25e889c13238671c8ce33a95bcf59f82e70c5c3.zip |
PRINCE: Fix potential out-of-bounds read (CID 1248502)
Since _opcodes[] has kNumOpcodes elements, kNumOpcodes itself is
not a valid index.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/prince/script.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/engines/prince/script.cpp b/engines/prince/script.cpp index 0e9dd27877..25249d3236 100644 --- a/engines/prince/script.cpp +++ b/engines/prince/script.cpp @@ -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, |