mirror of
https://github.com/radareorg/radare2.git
synced 2025-03-04 04:17:25 +00:00
Fix #6516 - Check null deref before crashing in r_io
This commit is contained in:
parent
4687135c5b
commit
b0fb7c9261
@ -485,7 +485,9 @@ R_API int r_core_read_at(RCore *core, ut64 addr, ut8 *buf, int size) {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
r_io_use_desc (core->io, core->file->desc);
|
||||
if (core->file) {
|
||||
r_io_use_desc (core->io, core->file->desc);
|
||||
}
|
||||
return r_io_read_at (core->io, addr, buf, size);
|
||||
}
|
||||
|
||||
|
@ -281,7 +281,7 @@ R_API int r_io_reopen(RIO *io, RIODesc *desc, int flags, int mode) {
|
||||
}
|
||||
|
||||
R_API int r_io_use_desc(RIO *io, RIODesc *d) {
|
||||
if (d) {
|
||||
if (d && d->plugin) {
|
||||
io->desc = d;
|
||||
io->plugin = d->plugin;
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user