Prevent an illegal memory access in readelf when attempting to parse a corrupt ELF file.
PR 22510 * readelf.c (load_debug_section): Fail if there are no section headers available.
This commit is contained in:
parent
e8020e54f4
commit
f425ec6600
@ -1,3 +1,9 @@
|
||||
2017-11-30 Nick Clifton <nickc@redhat.com>
|
||||
|
||||
PR 22510
|
||||
* readelf.c (load_debug_section): Fail if there are no section
|
||||
headers available.
|
||||
|
||||
2017-11-29 Nick Clifton <nickc@redhat.com>
|
||||
|
||||
PR 22508
|
||||
|
@ -13574,6 +13574,10 @@ load_debug_section (enum dwarf_section_display_enum debug, void * data)
|
||||
Elf_Internal_Shdr * sec;
|
||||
Filedata * filedata = (Filedata *) data;
|
||||
|
||||
/* Without section headers we cannot find any sections. */
|
||||
if (filedata->section_headers == NULL)
|
||||
return FALSE;
|
||||
|
||||
if (filedata->string_table == NULL)
|
||||
{
|
||||
Elf_Internal_Shdr * strs;
|
||||
|
Loading…
x
Reference in New Issue
Block a user