mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-27 09:38:57 +00:00
Check number of sections overflow
* elf.c (assign_section_numbers): Check if number of sections >= SHN_LORESERVE. * elfcode.h (elf_object_p): Likewise.
This commit is contained in:
@@ -633,8 +633,9 @@ elf_object_p (bfd *abfd)
|
||||
if (i_ehdrp->e_shnum == SHN_UNDEF)
|
||||
{
|
||||
i_ehdrp->e_shnum = i_shdr.sh_size;
|
||||
if (i_ehdrp->e_shnum != i_shdr.sh_size
|
||||
|| i_ehdrp->e_shnum == 0)
|
||||
if (i_ehdrp->e_shnum >= SHN_LORESERVE
|
||||
|| i_ehdrp->e_shnum != i_shdr.sh_size
|
||||
|| i_ehdrp->e_shnum == 0)
|
||||
goto got_wrong_format_error;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user