Skip to content
Commit 8d783d5e authored by Alan Modra's avatar Alan Modra
Browse files

looping in bfd_mach_o_fat_openr_next_archived_file

mach-o.c doesn't sanity check mach-o-fat archives, making it easy for
fuzzers to create an archive with mach_o_fat_archentry headers that
point to the same offset.  bfd_mach_o_fat_openr_next_archived_file
uses the previous element offset to find its header, and thus the next
element.  If two offsets are the same, any tool reading the archive
will get stuck.  This patch rejects such archives, and any with
overlapping elements.

	* mach-o.c (overlap_previous): New function.
	(bfd_mach_o_fat_archive_p): Sanity check that elements do not
	overlap each other or the file and archive headers.
parent faf351b5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment