mirror of
https://github.com/radareorg/radare2.git
synced 2024-12-28 00:16:55 +00:00
Fix possible null deref in nro
This commit is contained in:
parent
31ab3c998f
commit
e0d116780c
@ -146,9 +146,12 @@ static void *load_bytes(RBinFile *arch, const ut8 *buf, ut64 sz, ut64 loadaddr,
|
||||
}
|
||||
|
||||
static bool load(RBinFile *arch) {
|
||||
const ut8 *bytes = arch ? r_buf_buffer (arch->buf) : NULL;
|
||||
ut64 sz = arch ? r_buf_size (arch->buf): 0;
|
||||
ut64 la = (arch && arch->o)? arch->o->loadaddr: 0;
|
||||
if (!arch || !arch->buf || !arch->o) {
|
||||
return false;
|
||||
}
|
||||
const ut64 sz = r_buf_size (arch->buf);
|
||||
const ut64 la = arch->o->loadaddr;
|
||||
const ut8 *bytes = r_buf_buffer (arch->buf);
|
||||
arch->o->bin_obj = load_bytes (arch, bytes, sz, la, arch? arch->sdb: NULL);
|
||||
return arch->o->bin_obj != NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user