Skip to content

Commit

Permalink
Fix null deref when building without any assembler plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed Oct 10, 2019
1 parent 95afa19 commit 32dafd2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion libr/core/cfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@
static int r_core_file_do_load_for_debug(RCore *r, ut64 loadaddr, const char *filenameuri);
static int r_core_file_do_load_for_io_plugin(RCore *r, ut64 baseaddr, ut64 loadaddr);

static bool __isMips (RAsm *a) {
return a && a->cur && a->cur->arch && strstr (a->cur->arch, "mips");
}

static void loadGP(RCore *core) {
if (strstr (core->assembler->cur->arch, "mips")) {
if (__isMips (core->assembler)) {
ut64 gp = r_num_math (core->num, "loc._gp");
if (!gp || gp == UT64_MAX) {
r_config_set (core->config, "anal.roregs", "zero");
Expand Down

0 comments on commit 32dafd2

Please sign in to comment.