+2018-02-06 Nick Clifton <nickc@redhat.com>
+
+ PR 22793
+ * readelf.c (find_section): Replace assertion with test and return
+ of NULL.
+ (find_section_by_address): Add test of section header table
+ existance.
+ (find_section_by_type): Likewise.
+ (find_section_in_set): Likewise.
+
2018-02-05 Maciej W. Rozycki <macro@mips.com>
* testsuite/binutils-all/mips/mips-reginfo.d: New test.
{
unsigned int i;
- assert (filedata->section_headers != NULL);
+ if (filedata->section_headers == NULL)
+ return NULL;
for (i = 0; i < filedata->file_header.e_shnum; i++)
if (streq (SECTION_NAME (filedata->section_headers + i), name))
{
unsigned int i;
+ if (filedata->section_headers == NULL)
+ return NULL;
+
for (i = 0; i < filedata->file_header.e_shnum; i++)
{
Elf_Internal_Shdr *sec = filedata->section_headers + i;
{
unsigned int i;
+ if (filedata->section_headers == NULL)
+ return NULL;
+
for (i = 0; i < filedata->file_header.e_shnum; i++)
{
Elf_Internal_Shdr *sec = filedata->section_headers + i;
{
unsigned int i;
+ if (filedata->section_headers == NULL)
+ return NULL;
+
if (set != NULL)
{
while ((i = *set++) > 0)