version 1.9, 2017/11/14 09:14:50 |
version 1.10, 2022/08/14 14:54:13 |
|
|
{ |
{ |
Elf_Ehdr *eh = (Elf_Ehdr *)p; |
Elf_Ehdr *eh = (Elf_Ehdr *)p; |
|
|
if (filesize < (off_t)sizeof(Elf_Ehdr)) { |
if (filesize < sizeof(Elf_Ehdr)) { |
warnx("file too small to be ELF"); |
warnx("file too small to be ELF"); |
return 0; |
return 0; |
} |
} |
|
|
return 0; |
return 0; |
} |
} |
if (eh->e_shoff > filesize) { |
if (eh->e_shoff > filesize) { |
warnx("bogus section table offset 0x%llx", (off_t)eh->e_shoff); |
warnx("bogus section table offset 0x%llx", |
|
(unsigned long long)eh->e_shoff); |
return 0; |
return 0; |
} |
} |
if (eh->e_shentsize < sizeof(Elf_Shdr)) { |
if (eh->e_shentsize < sizeof(Elf_Shdr)) { |