Fix segfault in zip:// and dex (thanks @pof for reporting)

This commit is contained in:
pancake 2012-09-23 13:30:28 +02:00
parent 3373aa51d7
commit 51c4610090
3 changed files with 3 additions and 2 deletions

View File

@ -1212,7 +1212,6 @@ decodeInstr (bfd_vma address, /* Address of this instruction. */
bfd_vma addr = s.addresses[s.operandBuffer[1] - '0'];
(*info->print_address_func) ((bfd_vma) addr, info);
(*func) (stream, "\n");
}
else
(*func) (stream, "%s",s.operandBuffer);

View File

@ -171,6 +171,8 @@ static RList* classes (RBinArch *arch) {
eprintf ("error malloc string length %d\n", len);
break;
}
if (entry.source_file> bin->header.strings_size || entry.source_file<0)
continue;
r_buf_read_at (bin->b, bin->strings[entry.source_file],
(ut8*)name, len);
//snprintf (ptr->name, sizeof (ptr->name), "field.%s.%d", name, i);

View File

@ -43,9 +43,9 @@ static RIODesc *__open(RIO *io, const char *file, int rw, int mode) {
if (system (cmd) != 0)
eprintf ("Use zip://<path-to-zip>//<path-inside-zip>\n");
}
eprintf ("Remove '%s' manually\n", d);
free (str);
free (d);
eprintf ("Remove '%s' manually\n", d);
return NULL;
}
r_io_redirect (io, NULL);