Skip to content

Commit

Permalink
Fix #8743 - Crash in ELF version parser on 32bit systems
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed Oct 25, 2017
1 parent 66ca846 commit 44ded3f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion libr/bin/format/elf/elf.c
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,12 @@ static Sdb *store_versioninfo_gnu_verdef(ELFOBJ *bin, Elf_(Shdr) *shdr, int sz)
verdef->vd_hash = READ32 (dfs, j)
verdef->vd_aux = READ32 (dfs, j)
verdef->vd_next = READ32 (dfs, j)
vstart += verdef->vd_aux;
int vdaux = verdef->vd_aux;
if (vdaux < 1) {
sdb_free (sdb_verdef);
goto out_error;
}
vstart += vdaux;
if (vstart > end || vstart + sizeof (Elf_(Verdaux)) > end) {
sdb_free (sdb_verdef);
goto out_error;
Expand Down

0 comments on commit 44ded3f

Please sign in to comment.