aboutsummaryrefslogtreecommitdiff
path: root/gas/config/obj-elf.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2018-04-16 16:39:15 +0100
committerNick Clifton <nickc@redhat.com>2018-04-16 16:39:15 +0100
commitc77852c8916415b089e56271b6ab9f793fdb413c (patch)
tree7a18a1c89e154da7ec5282448c5c63bcf49f9047 /gas/config/obj-elf.c
parentfc7aa874aad7eea29014c5591174d57f81500d69 (diff)
downloadbinutils-c77852c8916415b089e56271b6ab9f793fdb413c.zip
binutils-c77852c8916415b089e56271b6ab9f793fdb413c.tar.gz
binutils-c77852c8916415b089e56271b6ab9f793fdb413c.tar.bz2
Fix illegal memory accesses in the assembler when attempting to parse corrup tinput files.
PR 23054 * cond.c (s_ifsef): Replace use of obstack_copy with obstack_alloc followed by memcpy. (s_if, s_ifb, s_ifc, s_ifeqs): Likewise. * obj-elf.c (elf_adjust_symtab): Check for local symbols before attempting to dereference the sy_next field of a symbol. * stabs.c (get_stab_string_offset): Fail if there is no string following the stab directive.
Diffstat (limited to 'gas/config/obj-elf.c')
-rw-r--r--gas/config/obj-elf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c
index 38b79f8..5870447 100644
--- a/gas/config/obj-elf.c
+++ b/gas/config/obj-elf.c
@@ -2471,7 +2471,8 @@ elf_adjust_symtab (void)
sy = symbol_find_exact (group_name);
if (!sy
|| (sy != symbol_lastP
- && (sy->sy_next == NULL
+ && (sy->sy_flags.sy_local_symbol
+ || sy->sy_next == NULL
|| sy->sy_next->sy_previous != sy)))
{
/* Create the symbol now. */