More fixes for memory access violations exposed by fuzzed binaries.
[deliverable/binutils-gdb.git] / bfd / elf32-cris.c
index c516b2f26e58da841ff4ddb68ebed7c6d37f68d9..0e9daba0086bafc87d4734ef6a1078a95072698d 100644 (file)
@@ -461,7 +461,11 @@ cris_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED,
   enum elf_cris_reloc_type r_type;
 
   r_type = ELF32_R_TYPE (dst->r_info);
-  BFD_ASSERT (r_type < (unsigned int) R_CRIS_max);
+  if (r_type >= R_CRIS_max)
+    {
+      _bfd_error_handler (_("%A: invalid CRIS reloc number: %d"), abfd, r_type);
+      r_type = 0;
+    }
   cache_ptr->howto = & cris_elf_howto_table [r_type];
 }
 
This page took 0.023178 seconds and 4 git commands to generate.