Fix off-by-one reported by @ret2libc (#8362)

half and closed ranges strikes
This commit is contained in:
Álvaro Felipe Melchor 2017-08-28 16:30:39 +02:00 committed by radare
parent aa9d2bcf41
commit 514930fc3a

View File

@ -85,7 +85,7 @@ static int onIterMap(SdbListIter *iter, RIO *io, ut64 vaddr, ut8 *buf,
ret += t;
}
if (map->to < vendaddr - 1) {
t = onIterMap (iter->p, io, map->to, buf + map->to - vaddr + 1, vendaddr - map->to - 1, match_flg, op, user);
t = onIterMap (iter->p, io, map->to + 1, buf + map->to - vaddr + 1, vendaddr - map->to - 1, match_flg, op, user);
if (t < 0) {
return t;
}