mirror of
https://github.com/radareorg/radare2.git
synced 2025-03-04 04:17:25 +00:00
Fix some null derefs in r2 gdb:// (without -d), still buggy
This commit is contained in:
parent
6d1be4ad06
commit
eb64f16fa3
@ -1061,7 +1061,7 @@ R_API int r_bin_load_io_at_offset_as_sz(RBin *bin, int fd, ut64 baseaddr,
|
||||
}
|
||||
}
|
||||
|
||||
if (!name) {
|
||||
if (!name && (st64)sz > 0) {
|
||||
// XXX - for the time being this is fine, but we may want to
|
||||
// change the name to something like
|
||||
// <xtr_name>:<bin_type_name>
|
||||
|
@ -369,7 +369,7 @@ static const char *r_debug_gdb_reg_profile(RDebug *dbg) {
|
||||
int arch = r_sys_arch_id (dbg->arch);
|
||||
int bits = dbg->anal->bits;
|
||||
check_connection (dbg);
|
||||
if (desc && desc->target.valid) {
|
||||
if (desc && desc->target.valid && desc->target.regprofile) {
|
||||
return strdup (desc->target.regprofile);
|
||||
}
|
||||
switch (arch) {
|
||||
|
@ -180,6 +180,9 @@ static ut64 __lseek(RIO *io, RIODesc *fd, ut64 offset, int whence) {
|
||||
}
|
||||
|
||||
static int __read(RIO *io, RIODesc *fd, ut8 *buf, int count) {
|
||||
if (!io || !fd || !buf || count < 1) {
|
||||
return -1;
|
||||
}
|
||||
memset (buf, 0xff, count);
|
||||
ut64 addr = io->off;
|
||||
if (!desc || !desc->data) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user