Ensure bufOffset calculation cannot result in a negative value

This commit is contained in:
ccrause 2021-08-09 22:22:43 +02:00
parent 11682281de
commit f515d77c42

View File

@ -1811,7 +1811,7 @@ begin
// TODO: Check if AnAddr is at lower address than length(CodeBin)
// and ensure ReadData size doesn't exceed available target memory.
// Fill out of bounds memory in buffer with "safe" value e.g. 0
if sz + ADisassembler.MaxInstructionSize > AnAddr then
if sz > AnAddr then
begin
FillByte(CodeBin[0], sz, 0);
// offset into buffer where active memory should start