aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf64-x86-64.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2015-01-05 17:43:34 -0800
committerH.J. Lu <hjl.tools@gmail.com>2015-01-05 17:43:34 -0800
commit533d0af0b8a8127b6f189222fc57aa11ce7aab2c (patch)
treeabc39b089488c67a6e935517b03a6e1917e3c6a4 /bfd/elf64-x86-64.c
parent9c90714c2f94b4486f56fcd9dcb70e27d983f7df (diff)
downloadgdb-533d0af0b8a8127b6f189222fc57aa11ce7aab2c.zip
gdb-533d0af0b8a8127b6f189222fc57aa11ce7aab2c.tar.gz
gdb-533d0af0b8a8127b6f189222fc57aa11ce7aab2c.tar.bz2
Return NULL on corrupt input
PR binutils/17512 * elf32-i386.c (elf_i386_get_plt_sym_val): Return NULL on corrupt input. * elf64-x86-64.c (elf_x86_64_get_plt_sym_val): Likewise.
Diffstat (limited to 'bfd/elf64-x86-64.c')
-rw-r--r--bfd/elf64-x86-64.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index cf63d6a..5cbb6fd 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -5559,6 +5559,9 @@ bad_return:
{
long reloc_index;
+ if (p->howto == NULL)
+ goto bad_return;
+
if (p->howto->type != R_X86_64_JUMP_SLOT
&& p->howto->type != R_X86_64_IRELATIVE)
continue;