aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2020-03-11 22:59:07 +1030
committerAlan Modra <amodra@gmail.com>2020-03-11 23:02:51 +1030
commit8248d21a5b8b7bb9970163b8b327f5ac2f857f33 (patch)
tree1b2764e397bea8d908e28a22ca51cdcaf21b499b /bfd
parent44f41bb7a1568dbe2e4e642e6c3c2e9ba3d47d92 (diff)
downloadgdb-8248d21a5b8b7bb9970163b8b327f5ac2f857f33.zip
gdb-8248d21a5b8b7bb9970163b8b327f5ac2f857f33.tar.gz
gdb-8248d21a5b8b7bb9970163b8b327f5ac2f857f33.tar.bz2
asan: som: unknown read
* som.c (setup_sections): Sanity check subspace.name.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog4
-rw-r--r--bfd/som.c3
2 files changed, 7 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index c60fe8c..3b252e1 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,9 @@
2020-03-11 Alan Modra <amodra@gmail.com>
+ * som.c (setup_sections): Sanity check subspace.name.
+
+2020-03-11 Alan Modra <amodra@gmail.com>
+
* elf64-ppc.c (ppc64_elf_inline_plt): Do increment rel in for loop.
2020-03-10 Alan Modra <amodra@gmail.com>
diff --git a/bfd/som.c b/bfd/som.c
index 3aa3d60..5676f0f 100644
--- a/bfd/som.c
+++ b/bfd/som.c
@@ -2197,6 +2197,9 @@ setup_sections (bfd *abfd,
som_swap_subspace_dictionary_in (&ext_subspace, &subspace);
/* Setup the subspace name string. */
+ if (subspace.name >= file_hdr->space_strings_size)
+ goto error_return;
+
subspace_name = subspace.name + space_strings;
amt = strlen (subspace_name) + 1;