Skip to content

Commit

Permalink
Don't attempt iword decoding outside of map
Browse files Browse the repository at this point in the history
  • Loading branch information
Rot127 committed Oct 2, 2024
1 parent 3b56eb0 commit f308431
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions librz/core/cgraph.c
Original file line number Diff line number Diff line change
Expand Up @@ -1319,6 +1319,7 @@ static st32 decode_iword_at(RZ_BORROW RzCore *core,
size_t bl = buf_len;
if (!read_aligned_to_mapped(core->io, addr, buf, &bl, leading_bytes)) {
RZ_LOG_ERROR("read_aligned_to_mapped() read from unmapped region at 0x%" PFMT64x ".\n", addr);
return -1;
}
bool success = core->analysis->cur->decode_iword(core->analysis, target_iword, addr, buf, bl, leading_bytes);
return success ? target_iword->size_bytes : -1;
Expand Down
12 changes: 6 additions & 6 deletions test/db/cmd/cmd_graph
Original file line number Diff line number Diff line change
Expand Up @@ -1030,12 +1030,12 @@ s 0xffffffffffffffff
agF
EOF
EXPECT=<<EOF
.--------------------.
| 0x5000000000 (e) |
`--------------------'
.--------------------------.
| 0xffffffffffffffff (e) |
`--------------------------'
.-----------.
| 0x0 (e) |
`-----------'
.-----------.
| 0x0 (e) |
`-----------'
EOF
RUN

Expand Down

0 comments on commit f308431

Please sign in to comment.