aboutsummaryrefslogtreecommitdiff
path: root/bfd/elflink.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2018-12-31 15:40:08 +1030
committerAlan Modra <amodra@gmail.com>2018-12-31 15:57:39 +1030
commit54025d5812ff100f5f0654eb7e1ffd50f2e37f5f (patch)
tree040e4fb2ea63c103133d0e94406215f990555349 /bfd/elflink.c
parentc96e057398b599a343cdff68325251346b71594e (diff)
downloadgdb-54025d5812ff100f5f0654eb7e1ffd50f2e37f5f.zip
gdb-54025d5812ff100f5f0654eb7e1ffd50f2e37f5f.tar.gz
gdb-54025d5812ff100f5f0654eb7e1ffd50f2e37f5f.tar.bz2
PR24041, Invalid Memory Address Dereference in elf_link_add_object_symbols
PR 24041 * elflink.c (elf_link_add_object_symbols): Don't segfault on crafted ET_DYN with no program headers.
Diffstat (limited to 'bfd/elflink.c')
-rw-r--r--bfd/elflink.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bfd/elflink.c b/bfd/elflink.c
index f5b411b..6e421fb 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -4186,7 +4186,7 @@ error_free_dyn:
all sections contained fully therein. This makes relro
shared library sections appear as they will at run-time. */
phdr = elf_tdata (abfd)->phdr + elf_elfheader (abfd)->e_phnum;
- while (--phdr >= elf_tdata (abfd)->phdr)
+ while (phdr-- > elf_tdata (abfd)->phdr)
if (phdr->p_type == PT_GNU_RELRO)
{
for (s = abfd->sections; s != NULL; s = s->next)