Fix some more null derefs related to the rbininfo change

This commit is contained in:
pancake 2015-03-25 17:29:38 +01:00
parent e59719942c
commit 6e52324885
3 changed files with 5 additions and 2 deletions

View File

@ -241,6 +241,8 @@ R_API int r_asm_use(RAsm *a, const char *name) {
char file[1024];
RAsmPlugin *h;
RListIter *iter;
if (!a || !name)
return R_FALSE;
r_list_foreach (a->plugins, iter, h)
if (!strcmp (h->name, name)) {
if (!a->cur || (a->cur && strcmp (a->cur->arch, h->arch))) {

View File

@ -1343,7 +1343,8 @@ R_API RBinObject * r_bin_object_find_by_arch_bits (RBinFile *binfile, const char
RBinInfo *info = NULL;
r_list_foreach (binfile->objs, iter, obj) {
info = obj->info;
if (info && (bits == info->bits) &&
if (info && info->arch && info->file &&
(bits == info->bits) &&
!strcmp (info->arch, arch) &&
!strcmp (info->file, name)){
break;

View File

@ -906,7 +906,7 @@ static int bin_symbols (RCore *r, int mode, ut64 baddr, ut64 laddr, int va, ut64
int bin_demangle = r_config_get_i (r->config, "bin.demangle");
const char *lang = r_config_get (r->config, "bin.lang");
RBinInfo *info = r_bin_get_info (r->bin);
int is_arm = info && !strcmp (info->arch, "arm");
int is_arm = info && info->arch && !strcmp (info->arch, "arm");
char str[R_FLAG_NAME_SIZE];
RList *symbols;
RListIter *iter;