[PATCH v2 0/9] RISC-V: Support version controling for ISA standard extensions and CSR
[deliverable/binutils-gdb.git] / bfd / som.c
index 3aa3d60b02bcd61372a61695f77fe01b27d85969..d36d163bb6b11910325c0581d9f1ad28fbab6045 100644 (file)
--- a/bfd/som.c
+++ b/bfd/som.c
@@ -2197,6 +2197,9 @@ setup_sections (bfd *abfd,
          som_swap_subspace_dictionary_in (&ext_subspace, &subspace);
 
          /* Setup the subspace name string.  */
+         if (subspace.name >= file_hdr->space_strings_size)
+           goto error_return;
+
          subspace_name = subspace.name + space_strings;
 
          amt = strlen (subspace_name) + 1;
@@ -6657,7 +6660,7 @@ som_write_armap (bfd *abfd,
   unsigned int module_count;
 
   /* We'll use this for the archive's date and mode later.  */
-  if (stat (abfd->filename, &statbuf) != 0)
+  if (stat (bfd_get_filename (abfd), &statbuf) != 0)
     {
       bfd_set_error (bfd_error_system_call);
       return FALSE;
This page took 0.024987 seconds and 4 git commands to generate.