From: Alan Modra Date: Sat, 22 Aug 2015 03:54:34 +0000 (+0930) Subject: Uninitialized vd_nodename X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=595bce7595e076391e7147b0c6db57a8edf2e406;p=binutils-gdb.git Uninitialized vd_nodename Belt and braces fix. Either of the changes here is sufficient to ensure vd_nodename is initialized properly. * elf.c (_bfd_elf_slurp_version_tables): Always init vd_nodename. Don't copy fields not set by _bfd_elf_swap_verdef_in. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index dcd0e88b65e..47b7642a225 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2015-08-22 Alan Modra + + * elf.c (_bfd_elf_slurp_version_tables): Always init vd_nodename. + Don't copy fields not set by _bfd_elf_swap_verdef_in. + 2015-08-19 Jiong Wang * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize new relocation diff --git a/bfd/elf.c b/bfd/elf.c index f20679e303c..f8e12958452 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -7871,7 +7871,7 @@ error_return_verref: goto error_return_bad_verdef; iverdef = &iverdefarr[(iverdefmem.vd_ndx & VERSYM_VERSION) - 1]; - memcpy (iverdef, &iverdefmem, sizeof (Elf_Internal_Verdef)); + memcpy (iverdef, &iverdefmem, offsetof (Elf_Internal_Verdef, vd_bfd)); iverdef->vd_bfd = abfd; @@ -7920,6 +7920,7 @@ error_return_verref: ((bfd_byte *) everdaux + iverdaux->vda_next)); } + iverdef->vd_nodename = NULL; if (iverdef->vd_cnt) iverdef->vd_nodename = iverdef->vd_auxptr->vda_nodename;