Skip to content

Commit

Permalink
Fix segfault in adf (#16230)
Browse files Browse the repository at this point in the history
  • Loading branch information
x0urc3 authored Mar 16, 2020
1 parent 3099a82 commit 4d38116
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libr/core/cmd_anal.c
Original file line number Diff line number Diff line change
Expand Up @@ -9235,12 +9235,12 @@ static int cmd_anal_all(RCore *core, const char *input) {
}

static bool anal_fcn_data (RCore *core, const char *input) {
RAnalFunction *fcn = r_anal_get_fcn_in (core->anal, core->offset, -1);
ut32 fcn_size = r_anal_function_size_from_entry (fcn);
RAnalFunction *fcn = r_anal_get_fcn_in (core->anal, core->offset, R_ANAL_FCN_TYPE_ANY);
if (fcn) {
int i;
bool gap = false;
ut64 gap_addr = UT64_MAX;
ut32 fcn_size = r_anal_function_size_from_entry (fcn);
char *bitmap = calloc (1, fcn_size);
if (bitmap) {
RAnalBlock *b;
Expand Down
8 changes: 8 additions & 0 deletions test/new/db/anal/x86_32
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,14 @@ EOF
CMDS=aa ; s sym.fastcaslled ; afc fastcall ; afva ; ?e ; pdf~arg,var
RUN

NAME=adf bug #16215
FILE=-
EXPECT=<<EOF
EOF
CMDS=<<EOF
adf
EOF

NAME=adf analysis on an obfuscated executable
FILE=../bins/pe/cmd_adf_sample0.exe
BROKEN=1
Expand Down

0 comments on commit 4d38116

Please # to comment.