Check r_io_read_at return value in VTable ##anal (#16653)

This commit is contained in:
pancake 2020-04-20 12:14:50 +02:00 committed by GitHub
parent 46c8de64c9
commit 52b1affcb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -111,13 +111,14 @@ static int vtable_is_addr_vtable_start(RVTableContext *context, ut64 curAddress)
// section in which currenct xref lies
if (vtable_addr_in_text_section (context, xref->addr)) {
ut8 buf[VTABLE_BUFF_SIZE];
int res = context->anal->iob.read_at (context->anal->iob.io, xref->addr, buf, sizeof(buf));
if (!context->anal->iob.read_at (context->anal->iob.io, xref->addr, buf, sizeof (buf))) {
continue;
}
RAnalOp analop = { 0 };
r_anal_op (context->anal, &analop, xref->addr, buf, sizeof(buf), R_ANAL_OP_MASK_BASIC);
if (analop.type == R_ANAL_OP_TYPE_MOV
|| analop.type == R_ANAL_OP_TYPE_LEA) {
if (analop.type == R_ANAL_OP_TYPE_MOV || analop.type == R_ANAL_OP_TYPE_LEA) {
r_list_free (xrefs);
r_anal_op_fini (&analop);
return true;