Skip to content

Commit

Permalink
Use RzPVector for sections (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
XVilka authored Mar 2, 2024
1 parent 3f9743b commit 9687c9c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/sil_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -464,10 +464,9 @@ static SectionHash *sil_section_digest(RzCore *core, RzBinSection *bsect, const
static bool sil_request_and_apply_hints(sil_t *sil, RzCore *core, sil_stats_t *stats) {
bool result = true;
const RzHashPlugin *blake = NULL;
const RzList *list = NULL;
const RzPVector *sections = NULL;
RzBinObject *bo = NULL;
RzBinSection *bsect = NULL;
RzListIter *it = NULL;
Binary *binary = NULL;

blake = rz_hash_plugin_by_name(core->hash, "blake3");
Expand All @@ -482,14 +481,16 @@ static bool sil_request_and_apply_hints(sil_t *sil, RzCore *core, sil_stats_t *s
return false;
}

list = rz_bin_object_get_sections_all(bo);
sections = rz_bin_object_get_sections_all(bo);

const char *type = bo->plugin ? bo->plugin->name : NULL;
const char *os = bo->info ? bo->info->os : NULL;

binary = proto_binary_new(type, os, rz_list_length(list));
binary = proto_binary_new(type, os, rz_pvector_len(sections));

rz_list_foreach (list, it, bsect) {
void **it;
rz_pvector_foreach (sections, it) {
bsect = (RzBinSection *)*it;
if (!(bsect->perm & RZ_PERM_X)) {
continue;
}
Expand Down

0 comments on commit 9687c9c

Please sign in to comment.