PR binutils/13622
authorNick Clifton <nickc@redhat.com>
Thu, 26 Jan 2012 09:59:30 +0000 (09:59 +0000)
committerNick Clifton <nickc@redhat.com>
Thu, 26 Jan 2012 09:59:30 +0000 (09:59 +0000)
* readelf.c (process_section_groups): If there are no section
headers do not scan for section groups.
(process_note_sections): Likewise for note sections.

binutils/ChangeLog
binutils/readelf.c

index a7ee38aca83b630dff8542ec3e5f7f32694874d0..304da8317df3d8657331fb400e653bc3c15e688f 100644 (file)
@@ -1,3 +1,10 @@
+2012-01-26  Nick Clifton  <nickc@redhat.com>
+
+       PR binutils/13622
+       * readelf.c (process_section_groups): If there are no section
+       headers do not scan for section groups.
+       (process_note_sections): Likewise for note sections.
+
 2012-01-20  Tristan Gingold  <gingold@adacore.com>
 
        * od-macho.c (OPT_SEG_SPLIT_INFO): New macro.
index 502c76e1f1604835ec2dd1b18474dfc366adb29a..861b2c1662c27b8e298d8045b9ea70970d6b4a02 100644 (file)
@@ -4961,7 +4961,8 @@ process_section_groups (FILE * file)
   if (section_headers == NULL)
     {
       error (_("Section headers are not available!\n"));
-      abort ();
+      /* PR 13622: This can happen with a corrupt ELF header.  */
+      return 0;
     }
 
   section_headers_groups = (struct group **) calloc (elf_header.e_shnum,
@@ -13070,7 +13071,7 @@ process_note_sections (FILE * file)
   int res = 1;
 
   for (i = 0, section = section_headers;
-       i < elf_header.e_shnum;
+       i < elf_header.e_shnum && section != NULL;
        i++, section++)
     if (section->sh_type == SHT_NOTE)
       res &= process_corefile_note_segment (file,
This page took 0.039657 seconds and 4 git commands to generate.