c/s
0943a03037 added some extra protection for overflowing the emulation
instruction cache, but Coverity points out that boundary condition is off by
one when memcpy()'ing out of the buffer.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Paul Durrant <paul.durrant@citrix.com>
* Will we overflow insn_buf[]? This shouldn't be able to happen,
* which means something went wrong with instruction decoding...
*/
- if ( insn_off > sizeof(hvmemul_ctxt->insn_buf) ||
- (insn_off + bytes) > sizeof(hvmemul_ctxt->insn_buf) )
+ if ( insn_off >= sizeof(hvmemul_ctxt->insn_buf) ||
+ (insn_off + bytes) >= sizeof(hvmemul_ctxt->insn_buf) )
{
ASSERT_UNREACHABLE();
return X86EMUL_UNHANDLEABLE;