mirror of
https://github.com/radareorg/radare2.git
synced 2025-02-03 12:12:06 +00:00
fixed use after free possibility from r_bin_reload
This commit is contained in:
parent
3a0422db24
commit
d82e709d0d
@ -386,6 +386,8 @@ R_API int r_bin_reload(RBin *bin, RIODesc *desc, ut64 baseaddr) {
|
||||
|
||||
the_obj_list = bf->objs;
|
||||
bf->objs = r_list_newf ((RListFree)r_bin_object_free);
|
||||
// invalidate current object reference
|
||||
bf->o = NULL;
|
||||
|
||||
// XXX - this needs to be reimplemented to account for
|
||||
// performance impacts.
|
||||
@ -435,6 +437,7 @@ R_API int r_bin_reload(RBin *bin, RIODesc *desc, ut64 baseaddr) {
|
||||
res = r_bin_load_io_at_offset_as (bin, desc, baseaddr, old_o->loadaddr, 0, old_o->boffset, old_o->plugin->name);
|
||||
}
|
||||
}
|
||||
bf->o = r_list_get_n (bf->objs, 0);
|
||||
r_list_free (the_obj_list);
|
||||
return res;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user