This is a fix for PR binutils/16723, where a corrupt .gnu.version_r section could

send readelf into an infinite loop.

	* readelf.c (process_version_sections): Prevent an infinite loop
	when the vn_next field is zero but there are still entries to be
	processed.
This commit is contained in:
Nick Clifton 2014-03-19 16:48:02 +00:00
parent ec92c392f7
commit c24cf8b6e8
2 changed files with 13 additions and 0 deletions

View File

@ -1,3 +1,10 @@
2014-03-19 Nick Clifton <nickc@redhat.com>
PR binutils/16723
* readelf.c (process_version_sections): Prevent an infinite loop
when the vn_next field is zero but there are still entries to be
processed.
2014-03-17 Tristan Gingold <gingold@adacore.com>
* od-macho.c (dump_section_header): Renames of dump_section.

View File

@ -8971,6 +8971,12 @@ process_version_sections (FILE * file)
if (j < ent.vn_cnt)
warn (_("Missing Version Needs auxillary information\n"));
if (ent.vn_next == 0 && cnt < section->sh_info)
{
warn (_("Corrupt Version Needs structure - offset to next structure is zero with entries still left to be processed\n"));
cnt = section->sh_info;
break;
}
idx += ent.vn_next;
}