mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-01-18 12:24:38 +08:00
PR24785, bfd crashes on empty .PPC.EMB.apuinfo section
PR 24785 * elf32-ppc.c (_bfd_elf_ppc_set_arch): Sanity check .PPC.EMB.apuinfo size before reading first word.
This commit is contained in:
parent
3836e1d1ab
commit
62a47958bd
@ -1,3 +1,9 @@
|
||||
2019-07-08 Alan Modra <amodra@gmail.com>
|
||||
|
||||
PR 24785
|
||||
* elf32-ppc.c (_bfd_elf_ppc_set_arch): Sanity check .PPC.EMB.apuinfo
|
||||
size before reading first word.
|
||||
|
||||
2019-07-02 Nick Clifton <nickc@redhat.com>
|
||||
|
||||
PR 24717
|
||||
|
@ -1077,7 +1077,9 @@ _bfd_elf_ppc_set_arch (bfd *abfd)
|
||||
if (mach == 0)
|
||||
{
|
||||
s = bfd_get_section_by_name (abfd, APUINFO_SECTION_NAME);
|
||||
if (s != NULL && bfd_malloc_and_get_section (abfd, s, &contents))
|
||||
if (s != NULL
|
||||
&& s->size >= 24
|
||||
&& bfd_malloc_and_get_section (abfd, s, &contents))
|
||||
{
|
||||
unsigned int apuinfo_size = bfd_get_32 (abfd, contents + 4);
|
||||
unsigned int i;
|
||||
|
Loading…
Reference in New Issue
Block a user