Skip to content

Commit

Permalink
Fix null deref in dbtj ##crash
Browse files Browse the repository at this point in the history
  • Loading branch information
radare authored and trufae committed Jun 12, 2024
1 parent 79283d8 commit f98a9b7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions binr/r2r/run.c
Original file line number Diff line number Diff line change
Expand Up @@ -1403,6 +1403,7 @@ R_API R2RTestResultInfo *r2r_run_test(R2RRunConfig *config, R2RTest *test) {
R2RJsonTest *json_test = test->json_test;
R2RProcessOutput *out = r2r_run_json_test (config, json_test, subprocess_runner, NULL);
success = r2r_check_json_test (out, json_test);
#define TEST_JSON_WITH_NO_FILES 0
#if TEST_JSON_WITH_NO_FILES
// R2_590 - enable these tests
if (strchr (json_test->cmd, '@')) {
Expand Down
8 changes: 5 additions & 3 deletions libr/core/cmd_debug.inc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3435,9 +3435,11 @@ static void get_backtrace_info(RCore* core, RDebugFrame* frame, ut64 addr, char*
*flagdesc2 = r_str_newf ("%s", f->name);
}
}
if (!strcmp (*flagdesc, *flagdesc2)) {
free (*flagdesc2);
*flagdesc2 = NULL;
if (*flagdesc && *flagdesc2) {
if (!strcmp (*flagdesc, *flagdesc2)) {
free (*flagdesc2);
*flagdesc2 = NULL;
}
}
if (pcstr && spstr) {
if (core->dbg->bits & R_SYS_BITS_64) {
Expand Down
2 changes: 1 addition & 1 deletion test/db/json/json4
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
rabin2 -gj /bin/ls
r2 -jV
# r2 -jV
pcj
# pdbj
# pdfj
Expand Down

0 comments on commit f98a9b7

Please sign in to comment.