Fix #4462 - null deref in elf parser

This commit is contained in:
pancake 2016-03-30 22:54:48 +02:00
parent 3e5d281815
commit ef317a026b

View File

@ -725,6 +725,7 @@ static bool init_dynstr(struct Elf_(r_bin_elf_obj_t) *bin) {
int i, r;
const char *section_name = NULL;
if (!bin || !bin->shdr) return false;
if (!bin->shstrtab) return false;
for (i = 0; i < bin->ehdr.e_shnum; ++i) {
if (bin->shdr[i].sh_name > bin->shstrtab_size)
return false;