libiberty: Check zero value shstrndx in simple-object-elf.c

From-SVN: r273718
This commit is contained in:
Ren Kimura 2019-07-23 07:33:32 +00:00 committed by Martin Liska
parent c0cdef59af
commit b1bc0f5035
2 changed files with 14 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2019-07-12 Ren Kimura <rkx1209dev@gmail.com>
* simple-object-elf.c (simple_object_elf_match): Check zero value shstrndx.
This fixes a Bug 90924.
2019-07-22 Martin Liska <mliska@suse.cz>
* simple-object-elf.c (simple_object_elf_copy_lto_debug_sections):

View File

@ -548,7 +548,15 @@ simple_object_elf_match (unsigned char header[SIMPLE_OBJECT_MATCH_HEADER_LEN],
XDELETE (eor);
return NULL;
}
if (eor->shstrndx == 0)
{
*errmsg = "invalid ELF shstrndx == 0";
*err = 0;
XDELETE (eor);
return NULL;
}
return (void *) eor;
}