Fix bounds check for flag registers in last byte of arena (#12949) (#15893)

This commit is contained in:
Xiao Di Guan 2020-01-27 02:19:19 +11:00 committed by radare
parent ee86cb00fc
commit 3a0dd576c0

View File

@ -79,7 +79,7 @@ R_API ut64 r_reg_get_value(RReg *reg, RRegItem *item) {
switch (item->size) {
case 1: {
int offset = item->offset / 8;
if (offset + item->size >= regset->arena->size) {
if (offset >= regset->arena->size) {
break;
}
return (regset->arena->bytes[offset] &