Skip to content

Commit

Permalink
Use r_str_get to prevent passing null to %s
Browse files Browse the repository at this point in the history
  • Loading branch information
cyanpencil committed Jul 16, 2018
1 parent 9390e23 commit d94d803
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion libr/asm/asm.c
Expand Up @@ -310,7 +310,7 @@ R_API int r_asm_use(RAsm *a, const char *name) {
if (!strcmp (h->name, name) && h->arch) {
if (!a->cur || (a->cur && strcmp (a->cur->arch, h->arch))) {
char *r2prefix = r_str_r2_prefix (R2_SDB_OPCODES);
char *file = r_str_newf ("%s/%s.sdb", r2prefix, h->arch);
char *file = r_str_newf ("%s/%s.sdb", r_str_get (r2prefix), h->arch);
r_asm_set_cpu (a, NULL);
sdb_free (a->pair);
a->pair = sdb_new (NULL, file, 0);
Expand Down
2 changes: 1 addition & 1 deletion libr/core/disasm.c
Expand Up @@ -1237,7 +1237,7 @@ static void ds_show_xrefs(RDisasmState *ds) {
}
ds_comment (ds, false, ")%s", COLOR_RESET (ds));
ds_newline (ds);
r_list_free (addrs);
r_list_purge (addrs);
R_FREE (name);
} else {
eprintf ("Corrupted database?\n");
Expand Down

0 comments on commit d94d803

Please sign in to comment.