Fix null pointer in bobj.c (#16015)

* fixing memory leaks
* use the return if macro
* removed redundand checks
* fixed some out of bound accesses
* fixed null pointer bug in bobj
This commit is contained in:
Marco Grassi 2020-02-21 18:05:55 +08:00 committed by GitHub
parent 213bfb622c
commit 05ee096280
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -256,6 +256,7 @@ static void r_bin_object_rebuild_classes_ht(RBinObject *o) {
RBinClass *klass;
RBinSymbol *method;
r_list_foreach (o->classes, it, klass) {
if (klass->name) {
ht_pp_insert (o->classes_ht, klass->name, klass);
r_list_foreach (klass->methods, it2, method) {
@ -264,6 +265,7 @@ static void r_bin_object_rebuild_classes_ht(RBinObject *o) {
}
}
}
}
R_API int r_bin_object_set_items(RBinFile *bf, RBinObject *o) {
r_return_val_if_fail (bf && o && o->plugin, false);