From: Nick Clifton Date: Mon, 30 Jan 2012 11:35:38 +0000 (+0000) Subject: PR binutils/13622 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5d80c62cea644f2a00a3130de1498fdb99ff706e;p=thirdparty%2Fbinutils-gdb.git 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. --- diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 2f5af61ba93..30101e5fde3 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,10 @@ +2012-01-26 Nick Clifton + + 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. + 2011-10-25 Alan Modra Apply mainline patches diff --git a/binutils/readelf.c b/binutils/readelf.c index 9e13190b4e0..bf053d92287 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -4937,7 +4937,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, @@ -12942,7 +12943,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,