Blob Blame History Raw
diff -rupN --no-dereference binutils-2.32/binutils/readelf.c binutils-2.32-new/binutils/readelf.c
--- binutils-2.32/binutils/readelf.c	2019-11-19 20:47:01.883590484 +0100
+++ binutils-2.32-new/binutils/readelf.c	2019-11-19 20:47:07.105619971 +0100
@@ -16200,6 +16200,13 @@ process_mips_specific (Filedata * fileda
 	  return FALSE;
 	}
 
+      /* PR 24243  */
+      if (sect->sh_size < sizeof (* eopt))
+	{
+	  error (_("The MIPS options section is too small.\n"));
+	  return FALSE;
+	}
+
       eopt = (Elf_External_Options *) get_data (NULL, filedata, options_offset, 1,
                                                 sect->sh_size, _("options"));
       if (eopt)