diff options
author | Nick Clifton <nickc@redhat.com> | 2023-09-28 12:37:59 +0100 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2023-09-28 12:37:59 +0100 |
commit | 6136093c0d009e3118abb08344e156d91144a046 (patch) | |
tree | 507244e1ffcb13fcb1b44c3a3bdeac2fa73347d6 /bfd/elf-bfd.h | |
parent | 2654f77d1424f6172d3026c524e96e14b5752ba1 (diff) | |
download | fsf-binutils-gdb-6136093c0d009e3118abb08344e156d91144a046.zip fsf-binutils-gdb-6136093c0d009e3118abb08344e156d91144a046.tar.gz fsf-binutils-gdb-6136093c0d009e3118abb08344e156d91144a046.tar.bz2 |
Fix: nm: SEGV on unknow address at nm.c:718 in print_symname
PR 30886 * elf-bfd.h (struct elf_obj_tdata): Add dt_strsz field.
* elf.c (_bfd_elf_get_dynamic_symbols): Add a NUL byte at the end of the string table. Initialise the dt_strsz field. (_bfd_elf_slurp_version_tables): Only free the contents if they were malloc'ed. Add checks before setting string pointers in the dt_strtab buffer.
Diffstat (limited to 'bfd/elf-bfd.h')
-rw-r--r-- | bfd/elf-bfd.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index 52d4d39..335081e 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -2039,7 +2039,8 @@ struct elf_obj_tdata size_t dt_symtab_count; size_t dt_verdef_count; size_t dt_verneed_count; - char *dt_strtab; + char * dt_strtab; + size_t dt_strsz; elf_section_list * symtab_shndx_list; bfd_vma gp; /* The gp value */ unsigned int gp_size; /* The gp size */ |