fix segfault in case of wrong address (#8359)

This commit is contained in:
Srimanta Barua 2017-08-28 18:57:37 +05:30 committed by radare
parent 4e36b5b8aa
commit aa9d2bcf41

View File

@ -827,7 +827,7 @@ int main(int argc, char **argv, char **envp) {
optind--; // take filename
}
fh = r_core_file_open (&r, pfile, perms, mapaddr);
iod = r.io ? r_io_desc_get (r.io, fh->fd) : NULL;
iod = (r.io && fh) ? r_io_desc_get (r.io, fh->fd) : NULL;
if (!strcmp (debugbackend, "gdb")) {
const char *filepath;
ut64 addr;