More fixes for memory access violations exposed by fuzzed binaries.
[deliverable/binutils-gdb.git] / bfd / elf32-xtensa.c
index e32496aa0c345b85ba2a518d6fe327f296c0a9df..85280e47df942f05c5e0a35aba7f8f550b51c64f 100644 (file)
@@ -479,7 +479,11 @@ elf_xtensa_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED,
 {
   unsigned int r_type = ELF32_R_TYPE (dst->r_info);
 
-  BFD_ASSERT (r_type < (unsigned int) R_XTENSA_max);
+  if (r_type >= (unsigned int) R_XTENSA_max)
+    {
+      _bfd_error_handler (_("%A: invalid XTENSA reloc number: %d"), abfd, r_type);
+      r_type = 0;
+    }
   cache_ptr->howto = &elf_howto_table[r_type];
 }
 
This page took 0.023271 seconds and 4 git commands to generate.