Skip to content

Commit

Permalink
Avoid logging stuff unless it's very important (#1231)
Browse files Browse the repository at this point in the history
  • Loading branch information
wargio authored Jun 20, 2021
1 parent 168e713 commit 1491329
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions librz/bin/format/elf/elf_segments.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ static bool get_elf_segment(ELFOBJ *bin, RzBinElfSegment *segment, ut64 offset,

segment->is_valid = verify_phdr_entry(bin, &segment->data);
if (!segment->is_valid) {
rz_assert_log(RZ_LOGLVL_WARN, "Invalid segment %zu at 0x%" PFMT64x "\n", pos, offset);
RZ_LOG_INFO("Invalid segment %zu at 0x%" PFMT64x "\n", pos, offset);
}

return true;
Expand Down Expand Up @@ -107,7 +107,11 @@ static bool check_phdr_size(ELFOBJ *bin) {
}

RZ_BORROW RzBinElfSegment *Elf_(rz_bin_elf_get_segment_with_type)(RZ_NONNULL ELFOBJ *bin, Elf_(Word) type) {
rz_return_val_if_fail(bin && bin->segments, NULL);
rz_return_val_if_fail(bin, NULL);
if (!bin->segments) {
return NULL;
}

RzBinElfSegment *iter;

rz_bin_elf_foreach_segments(bin, iter) {
Expand Down

0 comments on commit 1491329

Please sign in to comment.