mirror of
https://github.com/radareorg/radare2.git
synced 2025-01-09 06:50:49 +00:00
Fix ELF crash (null deref when missing shdr
This commit is contained in:
parent
176054c006
commit
48e5f8fc7e
@ -1782,7 +1782,7 @@ RBinElfReloc* Elf_(r_bin_elf_get_relocs)(struct Elf_(r_bin_elf_obj_t) *bin) {
|
||||
eprintf ("Warning: malformed file, relocation entry #%u is partially beyond the end of section %u.\n", rel, i);
|
||||
}
|
||||
if (bin->ehdr.e_type == ET_REL) {
|
||||
if (g_sections[i].info < bin->ehdr.e_shnum) {
|
||||
if (g_sections[i].info < bin->ehdr.e_shnum && bin->shdr) {
|
||||
ret[rel].rva = bin->shdr[g_sections[i].info].sh_offset + ret[rel].offset;
|
||||
ret[rel].rva = Elf_(r_bin_elf_p2v) (bin, ret[rel].rva);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user