Fix an assertion failure when parsing a fuzzed x86_64 ELF binary.
authorNick Clifton <nickc@redhat.com>
Tue, 26 Sep 2017 15:03:10 +0000 (16:03 +0100)
committerNick Clifton <nickc@redhat.com>
Tue, 26 Sep 2017 15:03:10 +0000 (16:03 +0100)
PR 22172
* elf64-x86-64.c (elf_x86_64_info_to_howto): Do not trigger an
assertion failure if elf_x86_64_rtype_to_howto has already issued
an error message.

bfd/ChangeLog
bfd/elf64-x86-64.c

index 0e670cdcf8ec84153a6bc5d5c4651b76649a056c..20451d77606d36be5123320d4f98d182aa7c65ee 100644 (file)
@@ -1,3 +1,10 @@
+2017-09-26  Nick Clifton  <nickc@redhat.com>
+
+       PR 22172
+       * elf64-x86-64.c (elf_x86_64_info_to_howto): Do not trigger an
+       assertion failure if elf_x86_64_rtype_to_howto has already issued
+       an error message.
+
 2017-09-26  Alan Modra  <amodra@gmail.com>
 
        PR 22210
index 84a26033245d096be366d68e959dbe37f4e7b181..4b19d0225988a7c5910d9a0f923b8932b3e07b07 100644 (file)
@@ -344,7 +344,8 @@ elf_x86_64_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr,
       && r_type != (unsigned int) R_X86_64_GNU_VTENTRY)
     r_type &= ~R_X86_64_converted_reloc_bit;
   cache_ptr->howto = elf_x86_64_rtype_to_howto (abfd, r_type);
-  BFD_ASSERT (r_type == cache_ptr->howto->type);
+
+  BFD_ASSERT (r_type == cache_ptr->howto->type || cache_ptr->howto->type == R_X86_64_NONE);
 }
 \f
 /* Support for core dump NOTE sections.  */
This page took 0.047077 seconds and 4 git commands to generate.