More fixes for memory access violations exposed by fuzzed binaries.
[deliverable/binutils-gdb.git] / bfd / elf32-rl78.c
index 2a5ec99bedd09ecce862d534f19df4c59a8cfa61..53c4f874dcc7a7493ab8bc6d9c5f27a8b1d08b4c 100644 (file)
@@ -276,7 +276,11 @@ rl78_info_to_howto_rela (bfd *               abfd ATTRIBUTE_UNUSED,
   unsigned int r_type;
 
   r_type = ELF32_R_TYPE (dst->r_info);
-  BFD_ASSERT (r_type < (unsigned int) R_RL78_max);
+  if (r_type >= (unsigned int) R_RL78_max)
+    {
+      _bfd_error_handler (_("%A: invalid RL78 reloc number: %d"), abfd, r_type);
+      r_type = 0;
+    }
   cache_ptr->howto = rl78_elf_howto_table + r_type;
 }
 \f
This page took 0.026487 seconds and 4 git commands to generate.