View | Details | Raw Unified | Return to bug 23932
Collapse All | Expand All

(-)a/bfd/elf.c (-8 / +9 lines)
Lines 7360-7373 rewrite_elf_program_header (bfd *ibfd, bfd *obfd) Link Here
7360
7364
7361
	  /* PR 23932.  A corrupt input file may contain sections that cannot
7365
	  /* PR 23932.  A corrupt input file may contain sections that cannot
7362
	     be assigned to any segment - because for example they have a
7366
	     be assigned to any segment - because for example they have a
7363
	     negative size - or segments that do not contain any sections.  */
7367
	     negative size - or segments that do not contain any sections.
7364
	  if (map->count == 0)
7368
	     But there are also valid reasons why a segment can be empty.
7365
	    {
7369
	     So allow a count of zero.  */
7366
	    sorry:
7367
	      bfd_set_error (bfd_error_sorry);
7368
	      free (sections);
7369
	      return FALSE;
7370
	    }
7371
7370
7372
	  /* Add the current segment to the list of built segments.  */
7371
	  /* Add the current segment to the list of built segments.  */
7373
	  *pointer_to_map = map;
7372
	  *pointer_to_map = map;
Lines 7399-7404 rewrite_elf_program_header (bfd *ibfd, bfd *obfd) Link Here
7399
	      map->includes_filehdr = 0;
7398
	      map->includes_filehdr = 0;
7400
	      map->includes_phdrs = 0;
7399
	      map->includes_phdrs = 0;
7401
	    }
7400
	    }
7401
7402
	  continue;
7403
	sorry:
7404
	  bfd_set_error (bfd_error_sorry);
7405
	  free (sections);
7406
	  return FALSE;
7402
	}
7407
	}
7403
      while (isec < section_count);
7408
      while (isec < section_count);
7404
7409

Return to bug 23932