Skip to content

Commit

Permalink
Fix #2883
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarofe authored and radare committed Jul 5, 2015
1 parent 693e728 commit 9dd078d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libr/bin/format/elf/elf.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,13 @@ static int Elf_(r_bin_elf_init_strtab)(struct Elf_(r_bin_elf_obj_t) *bin) {
bin->strtab_section = &bin->shdr[bin->ehdr.e_shstrndx];

bin->shstrtab_size = bin->strtab_section->sh_size;
if (bin->shstrtab_size > bin->size) return R_FALSE;

if ((bin->shstrtab = calloc (1, bin->shstrtab_size+1)) == NULL) {
perror ("malloc");
bin->shstrtab = NULL;
return R_FALSE;
}
memset (bin->shstrtab, 0, bin->shstrtab_size);

if (bin->shstrtab_section->sh_offset > bin->size){
R_FREE (bin->shstrtab);
Expand Down

0 comments on commit 9dd078d

Please sign in to comment.