Fix #6882 - tricore byte copy

This commit is contained in:
Giovanni 2017-03-03 00:10:32 +01:00 committed by Maijin
parent f41e941341
commit 780b834e61

View File

@ -18,8 +18,8 @@ static ut8 bytes[128];
static int tricore_buffer_read_memory (bfd_vma memaddr, bfd_byte *myaddr, ut32 length, struct disassemble_info *info) {
int delta = memaddr - Offset;
if (delta >= 0 && length > delta && length < sizeof(bytes)) {
memcpy (myaddr, bytes + delta, length - delta);
if (delta >= 0 && length + delta < sizeof(bytes)) {
memcpy (myaddr, bytes + delta, length);
}
return 0;
}