Skip to content

Commit

Permalink
Fix bug when buckets are empty
Browse files Browse the repository at this point in the history
  • Loading branch information
romainthomas committed Jun 11, 2017
1 parent 241aac7 commit 21a6c30
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ELF/Parser.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,10 @@ uint32_t Parser::nb_dynsym_gnu_hash(void) const {
} catch (const read_out_of_bound&) {
throw corrupted("GNU Hash, hash_buckets corrupted");
}
if (buckets.size() == 0) {
return 0;
}

uint32_t nb_symbols = *std::max_element(std::begin(buckets), std::end(buckets));

if (nb_symbols == 0) {
Expand Down

0 comments on commit 21a6c30

Please sign in to comment.